mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
git-svn-id: svn://ultimatepp.org/upp/trunk@1413 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
f423c516ae
commit
8faf656091
9 changed files with 3410 additions and 0 deletions
2613
bazaar/OfficeAutomation/OfficeAutomation.cpp
Normal file
2613
bazaar/OfficeAutomation/OfficeAutomation.cpp
Normal file
File diff suppressed because it is too large
Load diff
113
bazaar/OfficeAutomation/OfficeAutomation.h
Normal file
113
bazaar/OfficeAutomation/OfficeAutomation.h
Normal file
|
|
@ -0,0 +1,113 @@
|
|||
#ifndef _OfficeAutomation_h
|
||||
#define _OfficeAutomation_h
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
class OfficeSheet
|
||||
{
|
||||
public:
|
||||
OfficeSheet();
|
||||
~OfficeSheet();
|
||||
|
||||
static bool IsAvailable(String type);
|
||||
|
||||
bool Init(String type);
|
||||
|
||||
bool AddSheet(bool visible);
|
||||
bool OpenSheet(String fileName, bool visible);
|
||||
|
||||
bool SetValue(int col, int row, Value value);
|
||||
bool SetValue(String cell, Value value);
|
||||
bool SetValue(Value value);
|
||||
Value GetValue(int col, int row);
|
||||
Value GetValue(String cell);
|
||||
bool Replace(Value search, Value replace);
|
||||
|
||||
bool SetBold(int col, int row, bool bold);
|
||||
bool SetBold(String cell, bool bold);
|
||||
bool SetBold(bool bold);
|
||||
bool SetFont(int col, int row, String name, int size);
|
||||
bool SetFont(String cell, String name, int size);
|
||||
bool SetFont(String name, int size);
|
||||
|
||||
bool Select(String range);
|
||||
bool Select(int fromX, int fromY, int toX, int toY);
|
||||
bool Select();
|
||||
/*// New functs for next versions
|
||||
void DefMatrix(int width, int height);
|
||||
bool FillSelectionMatrix();
|
||||
void SetMatrixValue(int i, int j, ::Value value);
|
||||
*/
|
||||
|
||||
bool Print();
|
||||
|
||||
bool SaveAs(String fileName, String type = "xls");
|
||||
bool Quit();
|
||||
|
||||
bool InsertTab(String name);
|
||||
bool ChooseTab(String name);
|
||||
bool ChooseTab(int index);
|
||||
bool RemoveTab(String name);
|
||||
bool RemoveTab(int index);
|
||||
int GetNumTabs();
|
||||
|
||||
String GetType()
|
||||
{
|
||||
if (type == SheetOPEN)
|
||||
return "Open";
|
||||
else
|
||||
return "Microsoft";
|
||||
}
|
||||
static void CellToColRow(const char *cell, int &col, int &row);
|
||||
static String ColRowToCell(const int col, const int row);
|
||||
|
||||
private:
|
||||
void *data;
|
||||
enum {SheetOPEN = 1, SheetMS};
|
||||
int type;
|
||||
};
|
||||
|
||||
class OfficeDoc
|
||||
{
|
||||
public:
|
||||
OfficeDoc();
|
||||
~OfficeDoc();
|
||||
|
||||
static bool IsAvailable(String type);
|
||||
|
||||
bool Init(String type);
|
||||
|
||||
bool AddDoc(bool visible);
|
||||
bool OpenDoc(String fileName, bool visible);
|
||||
|
||||
bool SetFont(String font, int size);
|
||||
bool SetBold(bool bold);
|
||||
bool SetItalic(bool italic);
|
||||
bool WriteText(String value);
|
||||
|
||||
bool Select();
|
||||
|
||||
bool Replace(String search, String replace);
|
||||
|
||||
bool Print();
|
||||
|
||||
bool SetSaved(bool saved);
|
||||
bool SaveAs(String fileName, String type = "doc");
|
||||
bool Quit();
|
||||
|
||||
String GetType()
|
||||
{
|
||||
if (type == DocOPEN)
|
||||
return "Open";
|
||||
else
|
||||
return "Microsoft";
|
||||
}
|
||||
|
||||
private:
|
||||
void *data;
|
||||
enum {DocOPEN = 1, DocMS};
|
||||
int type;
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
27
bazaar/OfficeAutomation/OfficeAutomation.t
Normal file
27
bazaar/OfficeAutomation/OfficeAutomation.t
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
#ifdef _MSC_VER
|
||||
#pragma setlocale("C")
|
||||
#endif
|
||||
// OfficeAutomation.cpp
|
||||
|
||||
T_("OfficeAutomation internal error. NULL IDispatch passed to AutoWrap()")
|
||||
esES("Error interno en OfficeAutomation. Pasado IDispatch nulo a AutoWrap()")
|
||||
|
||||
T_("Error")
|
||||
esES("Error")
|
||||
|
||||
T_("OfficeAutomation internal error. Command \"%s\" not found for object or "
|
||||
"problem when running it")
|
||||
esES("Error interno en OfficeAutomation. Orden \"%s\" no encontrada para objeto "
|
||||
"o problema al ejecutarla")
|
||||
|
||||
T_("Ole error")
|
||||
esES("Error en Ole")
|
||||
|
||||
T_("OfficeAutomation internal error. Application not registered properly")
|
||||
esES("Error interno en OfficeAutomation. Aplicación no registrada correctamente")
|
||||
|
||||
T_("Excel workbooks not loaded properly")
|
||||
esES("Libro de Excel no abierto correctamente")
|
||||
|
||||
T_("Word document not loaded properly")
|
||||
esES("Documento de Word no abierto correctamente")
|
||||
20
bazaar/OfficeAutomation/OfficeAutomation.upp
Normal file
20
bazaar/OfficeAutomation/OfficeAutomation.upp
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
description "Automation of Office suites OpenOffice and Microsoft\377BI28,170,255";
|
||||
|
||||
noblitz;
|
||||
|
||||
uses
|
||||
Core;
|
||||
|
||||
library(WIN32) Oleaut32;
|
||||
|
||||
file
|
||||
OfficeAutomation.h,
|
||||
OfficeAutomationBase.h,
|
||||
OfficeAutomation.cpp,
|
||||
srcdoc.tpp,
|
||||
src.tpp,
|
||||
OfficeAutomation.t;
|
||||
|
||||
mainconfig
|
||||
"" = "MT";
|
||||
|
||||
260
bazaar/OfficeAutomation/OfficeAutomationBase.h
Normal file
260
bazaar/OfficeAutomation/OfficeAutomationBase.h
Normal file
|
|
@ -0,0 +1,260 @@
|
|||
#ifndef _OfficeAutomationBase_h
|
||||
#define _OfficeAutomationBase_h
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
typedef IDispatch* ObjectOle;
|
||||
|
||||
class VariantOle
|
||||
{
|
||||
public:
|
||||
VariantOle();
|
||||
~VariantOle();
|
||||
void Bool(bool val);
|
||||
void Int(int val);
|
||||
void Int4(long val);
|
||||
void Real4(float val);
|
||||
void Real8(double val);
|
||||
void BString(String str);
|
||||
void Optional();
|
||||
void ObjectOle(::ObjectOle var);
|
||||
void Time(Upp::Time t);
|
||||
void ArrayDim(int sizeX);
|
||||
void ArrayDim(int sizeX, int sizeY);
|
||||
void ArraySetValue(int x, ::Value value);
|
||||
void ArraySetVariant(int x, VariantOle &value);
|
||||
void ArraySetValue(int x, int y, ::Value value);
|
||||
void ArraySetVariant(int x, int y, VariantOle &value);
|
||||
void Value(::Value value);
|
||||
|
||||
public:
|
||||
VARIANT var;
|
||||
};
|
||||
|
||||
class MSSheet
|
||||
{
|
||||
public:
|
||||
MSSheet();
|
||||
~MSSheet();
|
||||
|
||||
static bool IsAvailable();
|
||||
|
||||
bool AddSheet(bool visible);
|
||||
bool OpenSheet(String fileName, bool visible);
|
||||
|
||||
bool SetValue(int col, int row, Value value);
|
||||
bool SetValue(String cell, Value value);
|
||||
bool SetValue(Value value);
|
||||
Value GetValue(int col, int row);
|
||||
Value GetValue(String cell);
|
||||
bool Replace(Value search, Value replace);
|
||||
|
||||
bool SetBold(int col, int row, bool bold);
|
||||
bool SetBold(String cell, bool bold);
|
||||
bool SetBold(bool bold);
|
||||
bool SetFont(int col, int row, String name, int size);
|
||||
bool SetFont(String cell, String name, int size);
|
||||
bool SetFont(String name, int size);
|
||||
|
||||
bool Select(String range);
|
||||
bool Select(int fromX, int fromY, int toX, int toY);
|
||||
bool Select();
|
||||
|
||||
bool Print();
|
||||
|
||||
bool SetSaved(bool);
|
||||
bool SaveAs(String fileName, String type = "xls");
|
||||
bool Quit();
|
||||
|
||||
bool InsertTab(String name);
|
||||
bool ChooseTab(String name);
|
||||
bool ChooseTab(int index);
|
||||
bool RemoveTab(String name);
|
||||
bool RemoveTab(int index);
|
||||
int GetNumTabs();
|
||||
|
||||
// New functs for next versions
|
||||
void DefMatrix(int width, int height);
|
||||
bool FillSelectionMatrix();
|
||||
void SetMatrixValue(int i, int j, ::Value value);
|
||||
|
||||
private:
|
||||
ObjectOle App;
|
||||
ObjectOle Books;
|
||||
ObjectOle Book;
|
||||
ObjectOle Sheet;
|
||||
ObjectOle Range;
|
||||
|
||||
VariantOle Matrix;
|
||||
|
||||
bool quit;
|
||||
|
||||
bool SetVisible(bool visible);
|
||||
};
|
||||
|
||||
class MSDoc
|
||||
{
|
||||
public:
|
||||
MSDoc();
|
||||
~MSDoc();
|
||||
|
||||
static bool IsAvailable();
|
||||
|
||||
bool AddDoc(bool visible);
|
||||
bool OpenDoc(String fileName, bool visible);
|
||||
|
||||
bool SetFont(String font, int size);
|
||||
bool SetBold(bool bold);
|
||||
bool SetItalic(bool italic);
|
||||
bool WriteText(String value);
|
||||
|
||||
bool Select();
|
||||
|
||||
bool Replace(String search, String replace);
|
||||
|
||||
bool Print();
|
||||
|
||||
bool SetSaved(bool);
|
||||
bool SaveAs(String fileName, String type = "doc");
|
||||
bool Quit();
|
||||
|
||||
private:
|
||||
ObjectOle App;
|
||||
ObjectOle Docs;
|
||||
ObjectOle Doc;
|
||||
ObjectOle Selection;
|
||||
|
||||
bool ReplaceSubset(String search, String replace);
|
||||
static String CleanString(String str);
|
||||
bool quit;
|
||||
|
||||
bool SetVisible(bool visible);
|
||||
};
|
||||
|
||||
#define wdFindContinue 1
|
||||
#define wdReplaceAll 2
|
||||
|
||||
|
||||
class OPENSheet
|
||||
{
|
||||
public:
|
||||
OPENSheet();
|
||||
~OPENSheet();
|
||||
|
||||
static bool IsAvailable();
|
||||
|
||||
bool AddSheet(bool visible);
|
||||
bool OpenSheet(String fileName, bool visible);
|
||||
|
||||
bool SetValue(int col, int row, Value value);
|
||||
bool SetValue(String cell, Value value);
|
||||
bool SetValue(Value value);
|
||||
Value GetValue(int col, int row);
|
||||
Value GetValue(String cell);
|
||||
bool Replace(Value search, Value replace);
|
||||
|
||||
bool SetBold(int col, int row, bool bold);
|
||||
bool SetBold(String cell, bool bold);
|
||||
bool SetBold(bool bold);
|
||||
bool SetFont(int col, int row, String name, int size);
|
||||
bool SetFont(String cell, String name, int size);
|
||||
bool SetFont(String name, int size);
|
||||
|
||||
bool Select(String range);
|
||||
bool Select(int fromX, int fromY, int toX, int toY);
|
||||
bool Select();
|
||||
/* // New functs for next versions
|
||||
void DefMatrix(int width, int height);
|
||||
bool FillSelectionMatrix();
|
||||
void SetMatrixValue(int i, int j, ::Value value);
|
||||
*/
|
||||
bool Print();
|
||||
|
||||
bool SetSaved(bool);
|
||||
bool SaveAs(String fileName, String type = "xls");
|
||||
bool Quit();
|
||||
|
||||
bool InsertTab(String name);
|
||||
bool ChooseTab(String name);
|
||||
bool ChooseTab(int index);
|
||||
bool RemoveTab(String name);
|
||||
bool RemoveTab(int index);
|
||||
int GetNumTabs();
|
||||
|
||||
// New functs for next versions
|
||||
bool SetItalic(String cell, bool italic);
|
||||
bool SetItalic(int col, int row, bool italic);
|
||||
bool SetItalic(bool italic);
|
||||
bool SetUnderline(bool underline);
|
||||
bool SetUnderline(String cell, bool underline);
|
||||
bool SetUnderline(int col, int row, bool underline);
|
||||
bool SetHorizJustify(int justify);
|
||||
bool SetHorizJustify(String cell, int justify);
|
||||
bool SetHorizJustify(int col, int row, int justify);
|
||||
bool SetVertJustify(String cell, int justify);
|
||||
bool SetVertJustify(int col, int row, int justify);
|
||||
bool SetCellBackColor(Color color);
|
||||
bool SetCellBackColor(String cell, Color color);
|
||||
bool SetCellBackColor(int col, int row, Color color);
|
||||
bool SetFormat(String format);
|
||||
bool SetColWidth(int col, int width);
|
||||
bool SetRowHeight(int row, int height);
|
||||
|
||||
private:
|
||||
ObjectOle ServiceManager;
|
||||
ObjectOle CoreReflection;
|
||||
ObjectOle Desktop;
|
||||
ObjectOle Document;
|
||||
ObjectOle Sheets;
|
||||
ObjectOle Sheet;
|
||||
ObjectOle Cell;
|
||||
ObjectOle Range;
|
||||
|
||||
bool selectedAll;
|
||||
bool SelCell(int x, int y);
|
||||
bool SetVisible(bool visible);
|
||||
bool quit;
|
||||
};
|
||||
|
||||
class OPENDoc
|
||||
{
|
||||
public:
|
||||
OPENDoc();
|
||||
~OPENDoc();
|
||||
|
||||
static bool IsAvailable();
|
||||
|
||||
bool AddDoc(bool visible);
|
||||
bool OpenDoc(String fileName, bool visible);
|
||||
|
||||
bool SetFont(String font, int size);
|
||||
bool SetBold(bool bold);
|
||||
bool SetItalic(bool italic);
|
||||
bool WriteText(String value);
|
||||
|
||||
bool Select();
|
||||
|
||||
bool Replace(String search, String replace);
|
||||
|
||||
bool Print();
|
||||
|
||||
bool SetSaved(bool);
|
||||
bool SaveAs(String fileName, String type = "doc");
|
||||
bool Quit();
|
||||
|
||||
// New functs for next versions
|
||||
bool SetColor(Color col);
|
||||
|
||||
private:
|
||||
ObjectOle ServiceManager;
|
||||
ObjectOle CoreReflection;
|
||||
ObjectOle Desktop;
|
||||
ObjectOle Document;
|
||||
ObjectOle Text;
|
||||
ObjectOle Cursor;
|
||||
bool quit;
|
||||
|
||||
bool SetVisible(bool visible);
|
||||
};
|
||||
|
||||
#endif
|
||||
4
bazaar/OfficeAutomation/init
Normal file
4
bazaar/OfficeAutomation/init
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef _OfficeAutomation_icpp_init_stub
|
||||
#define _OfficeAutomation_icpp_init_stub
|
||||
#include "Core/init"
|
||||
#endif
|
||||
121
bazaar/OfficeAutomation/src.tpp/OfficeDoc$en-us.tpp
Normal file
121
bazaar/OfficeAutomation/src.tpp/OfficeDoc$en-us.tpp
Normal file
|
|
@ -0,0 +1,121 @@
|
|||
topic "OfficeDoc class reference";
|
||||
[ $$0,0#00000000000000000000000000000000:Default]
|
||||
[i448;a25;kKO9; $$1,0#37138531426314131252341829483380:structitem]
|
||||
[l288;2 $$2,0#27521748481378242620020725143825:desc]
|
||||
[0 $$3,0#96390100711032703541132217272105:end]
|
||||
[H6;0 $$4,0#05600065144404261032431302351956:begin]
|
||||
[i448;a25;kKO9;2 $$5,0#37138531426314131252341829483370:codeitem]
|
||||
[{_}
|
||||
[s1;:OfficeDoc`:`:class: [@(0.0.255)4 class][4 _][*4 OfficeDoc]&]
|
||||
[s0;2 &]
|
||||
[s0; [2 OfficeDoc class serves to manage documents made with OpenOffice
|
||||
Doc or Microsoft Office Word.]&]
|
||||
[s0; [2 The class methods are designed to be as simple as possible
|
||||
and are exactly the same for both suites.]&]
|
||||
[s0; [2 OfficeDoc handles the suites through `"Ole Automation`" so
|
||||
it requires either OpenOffice or Microsoft Office to be previosly
|
||||
installed in the computer.]&]
|
||||
[s0;2 &]
|
||||
[ {{10000F(128)G(128)@1 [s0;%% [* Constructor detail]]}}&]
|
||||
[s3; &]
|
||||
[s5;:OfficeDoc`:`:OfficeDoc`(`): [* OfficeDoc]()&]
|
||||
[s2;%% OfficeDoc constructor. It has no arguments as in function
|
||||
Init() it is defined which Office suite is going to be used.&]
|
||||
[s3; &]
|
||||
[ {{10000F(128)G(128)@1 [s0;%% [* Public Method List]]}}&]
|
||||
[s3; &]
|
||||
[s5;:OfficeDoc`:`:`~OfficeDoc`(`): [@(0.0.255) `~][* OfficeDoc]()&]
|
||||
[s2;%% OfficeDoc destructor. It closes document editor application.&]
|
||||
[s3; &]
|
||||
[s4;* &]
|
||||
[s5;:OfficeDoc`:`:IsAvailable`(String`): [@(0.0.255) static] [@(0.0.255) bool]_[* IsAvailab
|
||||
le]([_^String^ String]_[*@3 type])&]
|
||||
[s2;%% It checks if office suit of name [%-*@3 type ]is available to
|
||||
be init. &]
|
||||
[s2;%% Valid values are `"Open`" and `"Microsoft`".&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:OfficeDoc`:`:Init`(String`): [@(0.0.255) bool]_[* Init]([_^String^ String]_[*@3 type])&]
|
||||
[s2;%% Initializes OfficeSheet to use [%-*@3 type].suite.&]
|
||||
[s2;%% Valid values are `"Open`" and `"Microsoft`".&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:OfficeDoc`:`:AddDoc`(bool`): [@(0.0.255) bool]_[* AddDoc]([@(0.0.255) bool]_[*@3 visible
|
||||
])&]
|
||||
[s2;%% Opens a new document. If [%-*@3 visible].is true the document
|
||||
application will be visible. If not all the rest of operations
|
||||
made over the document will be hidden for the user.&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:OfficeDoc`:`:OpenDoc`(String`,bool`): [@(0.0.255) bool]_[* OpenDoc]([_^String^ String]_
|
||||
[*@3 fileName], [@(0.0.255) bool]_[*@3 visible])&]
|
||||
[s2;%% Opens an existing document file whose name is [%-*@3 fileName.
|
||||
]If [%-*@3 visible ]is true the document application will be visible.
|
||||
If not all the rest of operations made over the document will
|
||||
be hidden for the user.&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:OfficeDoc`:`:SetFont`(String`,int`): [@(0.0.255) bool]_[* SetFont]([_^String^ String]_
|
||||
[*@3 font], [@(0.0.255) int]_[*@3 size])&]
|
||||
[s2;%% Sets the [%-*@3 font] type and [%-*@3 size ]in points. From now
|
||||
all the text entered will use the font and size defined.&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:OfficeDoc`:`:SetBold`(bool`): [@(0.0.255) bool]_[* SetBold]([@(0.0.255) bool]_[*@3 bold])
|
||||
&]
|
||||
[s2;%% Sets or unsets text [%-*@3 bold ]letters. From now all the text
|
||||
entered will be bold or not depending on value [%-*@3 bold].&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:OfficeDoc`:`:SetItalic`(bool`): [@(0.0.255) bool]_[* SetItalic]([@(0.0.255) bool]_[*@3 i
|
||||
talic])&]
|
||||
[s2;%% Sets or unsets text [%-*@3 italic].letters. From now all the
|
||||
text entered will be italic or not depending on value [%-*@3 italic].&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:OfficeDoc`:`:WriteText`(String`): [@(0.0.255) bool]_[* WriteText]([_^String^ String]_[*@3 v
|
||||
alue])&]
|
||||
[s2;%% Writes the text [%-*@3 value].&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:OfficeDoc`:`:Select`(`): [@(0.0.255) bool]_[* Select]()&]
|
||||
[s2;%% Selects all document.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:OfficeDoc`:`:Replace`(String`,String`): [@(0.0.255) bool]_[* Replace]([_^String^ Strin
|
||||
g]_[*@3 search], [_^String^ String]_[*@3 replace])&]
|
||||
[s2;%% Replaces value [%-*@3 search] with value [%-*@3 replace].in all
|
||||
the document.&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:OfficeDoc`:`:Print`(`): [@(0.0.255) bool]_[* Print]()&]
|
||||
[s2;%% Prints the document.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:OfficeDoc`:`:SetSaved`(bool`): [@(0.0.255) bool]_[* SetSaved]([@(0.0.255) bool
|
||||
][*@3 saved])&]
|
||||
[s2;%% Sets or unsets the flag [%-*@3 saved], so that the application
|
||||
did not ask for saving the document if the application receives
|
||||
the Quit() order.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:OfficeDoc`:`:SaveAs`(String`,String`): [@(0.0.255) bool]_[* SaveAs]([_^String^ String]_
|
||||
[*@3 fileName], [_^String^ String]_[*@3 type]_`=_`"doc`")&]
|
||||
[s2;%% Saves the opened [%-*@3 fileName] with format [%-*@3 type]. &]
|
||||
[s2;%% Formats admitted depend on the implementation but are basically:&]
|
||||
[s2;%% -|`- OpenOffice: -|`"doc`", `"rtf`", `"psw`", `"html`", `"txt`",
|
||||
`"pdf`" and `"odt`".&]
|
||||
[s2;%% -|`- Microsoft: -|`"rtf`", `"html`", `"txt`", `"docx`" and `"doc`".&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:OfficeDoc`:`:Quit`(`): [@(0.0.255) bool]_[* Quit]()&]
|
||||
[s2;%% Closes the spreadsheet application.&]
|
||||
[s2;%% -|It is also called by the class destructor&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:OfficeDoc`:`:GetType`(`): [_^String^ String]_[* GetType]()&]
|
||||
[s2;%% Returns the spreadsheet type.&]
|
||||
[s2;%% Valid values are:&]
|
||||
[s2;%% `- `"Open`"&]
|
||||
[s2;%% `- `"Microsoft`"&]
|
||||
[s0; ]
|
||||
234
bazaar/OfficeAutomation/src.tpp/OfficeSheet$en-us.tpp
Normal file
234
bazaar/OfficeAutomation/src.tpp/OfficeSheet$en-us.tpp
Normal file
|
|
@ -0,0 +1,234 @@
|
|||
topic "OfficeSheet class reference";
|
||||
[ $$0,0#00000000000000000000000000000000:Default]
|
||||
[i448;a25;kKO9; $$1,0#37138531426314131252341829483380:structitem]
|
||||
[l288;2 $$2,0#27521748481378242620020725143825:desc]
|
||||
[0 $$3,0#96390100711032703541132217272105:end]
|
||||
[H6;0 $$4,0#05600065144404261032431302351956:begin]
|
||||
[i448;a25;kKO9;2 $$5,0#37138531426314131252341829483370:codeitem]
|
||||
[{_}
|
||||
[s1;:OfficeSheet`:`:class: [@(0.0.255)4 class][4 _][*4 OfficeSheet]&]
|
||||
[s2;* &]
|
||||
[s0; [2 OfficeSheet class serves to manage spreadsheets made with OpenOffice
|
||||
Calc or Microsoft Office Excel.]&]
|
||||
[s0; [2 The class methods are designed to be as simple as possible
|
||||
and are exactly the same for both suites.]&]
|
||||
[s0; [2 OfficeSheet handles the suites through `"Ole Automation`" so
|
||||
it requires either OpenOffice or Microsoft Office to be previosly
|
||||
installed in the computer.]&]
|
||||
[s0;2 &]
|
||||
[ {{10000F(128)G(128)@1 [s0;%% [* Constructor detail]]}}&]
|
||||
[s3; &]
|
||||
[s5;:OfficeSheet`:`:OfficeSheet`(`): [* OfficeSheet]()&]
|
||||
[s2;%% OfficeSheet constructor. It has no arguments as in function
|
||||
Init() it is defined which Office suite is going to be used.&]
|
||||
[s3; &]
|
||||
[ {{10000F(128)G(128)@1 [s0;%% [* Public Method List]]}}&]
|
||||
[s3; &]
|
||||
[s5;:OfficeSheet`:`:`~OfficeSheet`(`): [@(0.0.255) `~][* OfficeSheet]()&]
|
||||
[s2;%% OfficeSheet destructor. It closes spreadsheet application.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:OfficeSheet`:`:IsAvailable`(String`): [@(0.0.255) static] [@(0.0.255) bool]_[* IsAvail
|
||||
able]([_^String^ String]_[*@3 type])&]
|
||||
[s2;%% It checks if office suit of name [%-*@3 type].is available to
|
||||
be init. &]
|
||||
[s2;%% Valid values are `"Open`" and `"Microsoft`".&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:OfficeSheet`:`:Init`(String`): [@(0.0.255) bool]_[* Init]([_^String^ String]_[*@3 type])
|
||||
&]
|
||||
[s2;%% Initializes OfficeSheet to use [%-*@3 type].suite.&]
|
||||
[s2;%% Valid values are `"Open`" and `"Microsoft`".&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:OfficeSheet`:`:AddSheet`(bool`): [@(0.0.255) bool]_[* AddSheet]([@(0.0.255) bool]_[*@3 v
|
||||
isible])&]
|
||||
[s2;%% Opens a new spreadsheet. If [%-*@3 visible].is true the spreadsheet
|
||||
application will be visible. If not all the rest of operations
|
||||
made over the spreadsheet will be hidden for the user.&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:OfficeSheet`:`:OpenSheet`(String`,bool`): [@(0.0.255) bool]_[* OpenSheet]([_^String^ S
|
||||
tring]_[*@3 fileName], [@(0.0.255) bool]_[*@3 visible])&]
|
||||
[s2;%% Opens an existing spreadsheet file whose name is [%-*@3 fileName.
|
||||
]If [%-*@3 visible ]is true the spreadsheet application will be
|
||||
visible. If not all the rest of operations made over the spreadsheet
|
||||
will be hidden for the user.&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:OfficeSheet`:`:SetValue`(int`,int`,Value`): [@(0.0.255) bool]_[* SetValue]([@(0.0.255) i
|
||||
nt]_[*@3 col], [@(0.0.255) int]_[*@3 row], [_^Value^ Value]_[*@3 value])&]
|
||||
[s2;%% Fills cell [%-*@3 col,] [%-*@3 row ][%- with the value] [%-*@3 value].
|
||||
[%-*@3 col,] [%-*@3 row ]origin is (1, 1). [%-*@3 value ]is inserted
|
||||
using the most adequate format depending on the [%-*@3 value] type.&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:OfficeSheet`:`:SetValue`(String`,Value`): [@(0.0.255) bool]_[* SetValue]([_^String^ St
|
||||
ring]_[*@3 cell], [_^Value^ Value]_[*@3 value])&]
|
||||
[s2;%% Fills cell [%-*@3 cell] [%- with the value ][%-*@3 value]. [%-*@3 cell
|
||||
]is a string that indicates the cell location with letters to
|
||||
indicate the column and a number to indicate the row as in `"B7`",
|
||||
following the format used in spreadsheets. [%-*@3 value ]is inserted
|
||||
using the most adequate format depending on the [%-*@3 value] type.&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:OfficeSheet`:`:SetValue`(Value`): [@(0.0.255) bool]_[* SetValue]([_^Value^ Value]_[*@3 v
|
||||
alue])&]
|
||||
[s2;%% Fills the range previously selected by Select() with [%-*@3 value].
|
||||
[%-*@3 value ]is inserted using the most adequate format depending
|
||||
on the [%-*@3 value] type.&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:OfficeSheet`:`:GetValue`(int`,int`): [_^Value^ Value]_[* GetValue]([@(0.0.255) int]_[*@3 c
|
||||
ol], [@(0.0.255) int]_[*@3 row])&]
|
||||
[s2;%% Returns the value got in cell [%-*@3 col,] [%-*@3 row]. [%-*@3 col,]
|
||||
[%-*@3 row ]origin is (1, 1).&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:OfficeSheet`:`:GetValue`(String`): [_^Value^ Value]_[* GetValue]([_^String^ String]_[*@3 c
|
||||
ell])&]
|
||||
[s2;%% Returns the value got in cell [%-*@3 cell]. [%-*@3 cell ]is a
|
||||
string that indicates the cell location with letters to indicate
|
||||
the column and a number to indicate the row as in `"B7`", following
|
||||
the format used in spreadsheets.&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:OfficeSheet`:`:Replace`(Value`,Value`): [@(0.0.255) bool]_[* Replace]([_^Value^ Value]_
|
||||
[*@3 search], [_^Value^ Value]_[*@3 replace])&]
|
||||
[s2;%% Replaces value [%-*@3 search] with value [%-*@3 replace].in the
|
||||
selected range by Select() or all the document.&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:OfficeSheet`:`:SetBold`(int`,int`,bool`): [@(0.0.255) bool]_[* SetBold]([@(0.0.255) in
|
||||
t]_[*@3 col], [@(0.0.255) int]_[*@3 row], [@(0.0.255) bool]_[*@3 bold])&]
|
||||
[s2;%% Sets or unsets cell bold letters in [%-*@3 col,] [%-*@3 row. col,]
|
||||
[%-*@3 row ]origin is (1, 1).&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:OfficeSheet`:`:SetBold`(String`,bool`): [@(0.0.255) bool]_[* SetBold]([_^String^ Strin
|
||||
g]_[*@3 cell], [@(0.0.255) bool]_[*@3 bold])&]
|
||||
[s2;%% Sets or unsets cell bold letters in [%-*@3 cell. cell ]is a
|
||||
string that indicates the cell location with letters to indicate
|
||||
the column and a number to indicate the row as in `"B7`", following
|
||||
the format used in spreadsheets.&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:OfficeSheet`:`:SetBold`(bool`): [@(0.0.255) bool]_[* SetBold]([@(0.0.255) bool]_[*@3 bol
|
||||
d])&]
|
||||
[s2;%% Sets or unsets cell bold letters in the selected range by
|
||||
Select() or all the document.&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:OfficeSheet`:`:SetFont`(int`,int`,String`,int`): [@(0.0.255) bool]_[* SetFont]([@(0.0.255) i
|
||||
nt]_[*@3 col], [@(0.0.255) int]_[*@3 row], [_^String^ String]_[*@3 name],
|
||||
[@(0.0.255) int]_[*@3 size])&]
|
||||
[s2;%% Sets in cell [%-*@3 col,] [%-*@3 row ]font [%-*@3 name ]with [%-*@3 size
|
||||
]in points. [%-*@3 cell ]is a string that indicates the cell location
|
||||
with letters to indicate the column and a number to indicate
|
||||
the row as in `"B7`", following the format used in spreadsheets.&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:OfficeSheet`:`:SetFont`(String`,String`,int`): [@(0.0.255) bool]_[* SetFont]([_^String^ S
|
||||
tring]_[*@3 cell], [_^String^ String]_[*@3 name], [@(0.0.255) int]_[*@3 size])&]
|
||||
[s2;%% Sets in [%-*@3 cell ]font [%-*@3 name ]with [%-*@3 size ]in points.
|
||||
[%-*@3 col,] [%-*@3 row ]origin is (1, 1).&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:OfficeSheet`:`:SetFont`(String`,int`): [@(0.0.255) bool]_[* SetFont]([_^String^ String
|
||||
]_[*@3 name], [@(0.0.255) int]_[*@3 size])&]
|
||||
[s2;%% Sets the selected range by Select() or all the document with
|
||||
font [%-*@3 name] with [%-*@3 size ]in points. &]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:OfficeSheet`:`:Select`(String`): [@(0.0.255) bool]_[* Select]([_^String^ String]_[*@3 ra
|
||||
nge])&]
|
||||
[s2;%% Selects [%-*@3 range]. [%-*@3 range ]is a string that indicates
|
||||
the range location with letters to indicate the column and a
|
||||
number to indicate the row of the top left and bottom right vertex
|
||||
as in `"B7:D9`", following the format used in spreadsheets.&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:OfficeSheet`:`:Select`(int`,int`,int`,int`): [@(0.0.255) bool]_[* Select]([@(0.0.255) i
|
||||
nt]_[*@3 fromX], [@(0.0.255) int]_[*@3 fromY], [@(0.0.255) int]_[*@3 toX],
|
||||
[@(0.0.255) int]_[*@3 toY])&]
|
||||
[s2;%% Selects range from top left vertex [%-*@3 fromX,] [%-*@3 fromY
|
||||
]to right bottom[%-*@3 toX,] [%-*@3 toY]. Origin is (1, 1).&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:OfficeSheet`:`:Select`(`): [@(0.0.255) bool]_[* Select]()&]
|
||||
[s2;%% Selects full sheet.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:OfficeSheet`:`:Print`(`): [@(0.0.255) bool]_[* Print]()&]
|
||||
[s2;%% Prints the selected spreadsheet.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:OfficeSheet`:`:SaveAs`(String`,String`): [@(0.0.255) bool]_[* SaveAs]([_^String^ Strin
|
||||
g]_[*@3 fileName], [_^String^ String]_[*@3 type]_`=_`"xls`")&]
|
||||
[s2;%% Saves the opened [%-*@3 fileName] with format [%-*@3 type]. &]
|
||||
[s2;%% Formats admitted depend on the implementation but are basically:&]
|
||||
[s2;%% -|`- OpenOffice: -|`"xls`", `"pxl`", `"html`", `"txt`", `"pdf`"
|
||||
and `"ods`".&]
|
||||
[s2;%% -|`- Microsoft: -|`"csv`", `"html`", `"txt`", `"xlsx`" and `"xls`"&]
|
||||
[s4; &]
|
||||
[s5;:OfficeSheet`:`:Quit`(`): [@(0.0.255) bool]_[* Quit]()&]
|
||||
[s2;%% Closes the spreadsheet application.&]
|
||||
[s2;%% -|It is also called by the class destructor&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:OfficeSheet`:`:InsertTab`(String`): [@(0.0.255) bool]_[* InsertTab]([_^String^ String]_
|
||||
[*@3 name])&]
|
||||
[s2;%% Inserts a new tab with [%-*@3 name].&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:OfficeSheet`:`:ChooseTab`(String`): [@(0.0.255) bool]_[* ChooseTab]([_^String^ String]_
|
||||
[*@3 name])&]
|
||||
[s2;%% Makes active tab with [%-*@3 name].&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:OfficeSheet`:`:ChooseTab`(int`): [@(0.0.255) bool]_[* ChooseTab]([@(0.0.255) int]_[*@3 i
|
||||
ndex])&]
|
||||
[s2;%% Makes active tab with [%-*@3 index], beginning from 1.&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:OfficeSheet`:`:RemoveTab`(String`): [@(0.0.255) bool]_[* RemoveTab]([_^String^ String]_
|
||||
[*@3 name])&]
|
||||
[s2;%% Remove tab with [%-*@3 name].&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:OfficeSheet`:`:RemoveTab`(int`): [@(0.0.255) bool]_[* RemoveTab]([@(0.0.255) int]_[*@3 i
|
||||
ndex])&]
|
||||
[s2;%% Removes tab with [%-*@3 index], beginning from 1.&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:OfficeSheet`:`:GetNumTabs`(`): [@(0.0.255) int]_[* GetNumTabs]()&]
|
||||
[s2;%% Gets the number of tabs.&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:OfficeSheet`:`:GetType`(`): [_^String^ String]_[* GetType]()&]
|
||||
[s2;%% Returns the spreadsheet type.&]
|
||||
[s2;%% Valid values are:&]
|
||||
[s2;%% `- `"Open`"&]
|
||||
[s2;%% `- `"Microsoft`"&]
|
||||
[s3; &]
|
||||
[s4; &]
|
||||
[s5;:OfficeSheet`:`:CellToColRow`(const char`*`,int`&`,int`&`): [@(0.0.255) static]
|
||||
[@(0.0.255) void]_[* CellToColRow]([@(0.0.255) const]_[@(0.0.255) char]_`*[*@3 cell],
|
||||
[@(0.0.255) int]_`&[*@3 col], [@(0.0.255) int]_`&[*@3 row])&]
|
||||
[s2;%% Converts [%-*@3 cell] into [%-*@3 col] and [%-*@3 row]. [%-*@3 cell
|
||||
]is a string that indicates the cell location with letters to
|
||||
indicate the column and a number to indicate the row as in `"B7`",
|
||||
following the format used in spreadsheets. [%-*@3 col,] [%-*@3 row
|
||||
]origin is (1, 1)&]
|
||||
[s3;%% &]
|
||||
[s4; &]
|
||||
[s5;:OfficeSheet`:`:ColRowToCell`(const int`,const int`): [@(0.0.255) static]
|
||||
[_^String^ String]_[* ColRowToCell]([@(0.0.255) const]_[@(0.0.255) int]_[*@3 col],
|
||||
[@(0.0.255) const]_[@(0.0.255) int]_[*@3 row])&]
|
||||
[s2;%% Returns the cell in text represented by [%-*@3 col], [%-*@3 row].
|
||||
Cell returned is a string that indicates the cell location with
|
||||
letters to indicate the column and a number to indicate the row
|
||||
as in `"B7`", following the format used in spreadsheets. [%-*@3 col,]
|
||||
[%-*@3 row ]origin is (1, 1)&]
|
||||
[s3;%% &]
|
||||
[s0; ]
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
topic "OfficeAutomation";
|
||||
[ $$0,0#00000000000000000000000000000000:Default]
|
||||
[a83;*R6 $$1,0#31310162474203024125188417583966:caption]
|
||||
[{_}%EN-US
|
||||
[s1; OfficeAutomation&]
|
||||
[s0; [2 Includes classes to handle office programs like spreadsheets
|
||||
and text editors:]&]
|
||||
[s0;i150;O0; [^topic`:`/`/OfficeAutomation`/src`/OfficeDoc`$en`-us^2 OfficeDoc]&]
|
||||
[s0;i150;O0; [^topic`:`/`/OfficeAutomation`/src`/OfficeSheet`$en`-us^2 OfficeSheet]&]
|
||||
[s0;2 &]
|
||||
[s0; [2 Supported office suites are OpenOffice and Microsoft Office.]&]
|
||||
[s0;2 &]
|
||||
[s0; [2 OfficeAutomation is implemented only in U`+`+ Windows version.]&]
|
||||
[s0; &]
|
||||
[s0; [/1 There have been efforts to implement the system on Posix systems.]&]
|
||||
[s0; [/1 Support of any kind about OpenOffice UNO in order to implement
|
||||
OfficeAutomation in Posix systems will be acknowledged.]&]
|
||||
[s0; ]
|
||||
Loading…
Add table
Add a link
Reference in a new issue