Foxit PDF SDK

fs_portfolio.h
Go to the documentation of this file.
1
15 #ifndef FS_PORTFOLIO_H_
16 #define FS_PORTFOLIO_H_
17
18 #include "common/fs_common.h"
19 #include "pdf/fs_pdfdoc.h"
20 #include "pdf/fs_filespec.h"
21
27 namespace foxit {
31 namespace pdf {
35 namespace portfolio {
36 class PortfolioNode;
37 class PortfolioFolderNode;
38 class PortfolioFileNode;
39 class SchemaField;
40 class Portfolio;
41
45 class PortfolioNode : public Base {
46 public:
52 typedef enum _Type {
54 e_TypeUnknown = 0,
56 e_TypeFolder = 1,
58 e_TypeFile = 2
59 } Type;
60
66 PortfolioNode(const PortfolioNode& other);
68 ~PortfolioNode();
76 PortfolioNode& operator = (const PortfolioNode& other);
77
85 bool operator == (const PortfolioNode& other) const;
93 bool operator != (const PortfolioNode& other) const;
94
102 bool IsEmpty() const;
103
110 Type GetNodeType() const;
111
112 // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
113 explicit PortfolioNode(FS_HANDLE handle = NULL);
114
115 };
116
118 FSDK_DEFINE_ARRAY(PortfolioNodeArray, PortfolioNode)
119
120 class PortfolioFileNode;
121
128 class PortfolioFolderNode FS_FINAL : public PortfolioNode {
129 public:
135 explicit PortfolioFolderNode(const PortfolioNode& other);
136
138 ~PortfolioFolderNode() {}
139
146 bool IsRoot() const;
147
154 WString GetName() const;
155
167 PortfolioFileNode AddFile(const wchar_t* file_path);
181 PortfolioFileNode AddFile(foxit::common::file::StreamCallback* file_stream, const wchar_t* file_name);
195 PortfolioFileNode AddPDFDoc(const PDFDoc& pdf_doc, const wchar_t* file_name);
196
204 PortfolioFolderNode AddSubFolder(const wchar_t* folder_name);
205
213 void RemoveSubNode(const PortfolioNode& sub_node);
214
223 PortfolioNodeArray GetSortedSubNodes() const;
224
233 DateTime GetModifiedDateTime() const;
239 DateTime GetCreationDateTime() const;
240
246 WString GetDescription() const;
254 void SetDescription(const wchar_t* description);
255
256 // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
257 explicit PortfolioFolderNode(FS_HANDLE handle = NULL);
258
259 };
260
266 class PortfolioFileNode FS_FINAL : public PortfolioNode {
267 public:
273 explicit PortfolioFileNode(const PortfolioNode& other);
274
276 ~PortfolioFileNode() {}
277
283 FileSpec GetFileSpec() const;
284
293 WString GetKeyName() const;
294
295 // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
296 explicit PortfolioFileNode(FS_HANDLE handle = NULL);
297
298 };
299
303 class SchemaField FS_FINAL : public Base {
304 public:
308 SchemaField();
309
315 SchemaField(const SchemaField& other);
323 SchemaField& operator = (const SchemaField& other);
324
332 bool operator == (const SchemaField& other) const;
340 bool operator != (const SchemaField& other) const;
341
349 bool IsEmpty() const;
350
352 ~SchemaField();
353
366 String GetKeyName() const;
367
382 void SetKeyName(const char* key_name);
383
406 String GetSubtypeName() const;
432 void SetSubtypeName(const char* subtype_name);
433
441 WString GetDisplayName() const;
451 void SetDisplayName(const wchar_t* display_name);
452
459 bool IsVisible() const;
468 void SetVisibility(bool is_visible);
469
470 // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
471 explicit SchemaField(FS_HANDLE handle);
472
473 };
474
476 FSDK_DEFINE_ARRAY(SchemaFieldArray, SchemaField)
477
478
484 class Portfolio FS_FINAL : public Base {
485 public:
491 typedef enum _InitialViewMode {
493 e_InitialViewUnknownMode = 0,
498 e_InitialViewDetailMode = 1,
503 e_InitialViewTileMode = 2,
507 e_InitialViewHidden = 3
508 } InitialViewMode;
509
510
520 static Portfolio CreatePortfolio();
521
532 static Portfolio CreatePortfolio(const foxit::pdf::PDFDoc& portfolio_pdf_doc);
533
539 Portfolio(const Portfolio& other);
547 Portfolio& operator = (const Portfolio& other);
548
556 bool operator == (const Portfolio& other) const;
564 bool operator != (const Portfolio& other) const;
565
573 bool IsEmpty() const;
574
576 ~Portfolio();
577
583 PDFDoc GetPortfolioPDFDoc() const;
584
593 PortfolioNode GetRootNode() const;
594
600 InitialViewMode GetInitialViewMode() const;
609 void SetInitialViewMode(InitialViewMode mode);
610
617 bool IsSortedInAscending() const;
627 void SetSortingOrder(bool use_ascending_order);
633 String GetSortingFieldKeyName() const;
641 void SetSortingFieldKeyName(const char* name);
642
651 WString GetInitialFileSpecKeyName() const;
663 void SetInitialFileSpecKeyName(const wchar_t* name);
664
672 SchemaFieldArray GetSchemaFields() const;
683 void SetSchemaFields(const SchemaFieldArray& field_array);
684
685 // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
686 explicit Portfolio(FS_HANDLE handle = NULL);
687
688 };
689
690 } // namespace portfolio
691 } // namespace pdf
692 } // namespace foxit
693
694 #endif // FS_PORTFOLIO_H_
695
foxit::pdf::portfolio::PortfolioNode::operator!=
bool operator!=(const PortfolioNode &other) const
Not equal operator.
foxit::pdf::portfolio::SchemaField::IsVisible
bool IsVisible() const
Check if current field is initially visible in application or not.
foxit::pdf::portfolio::PortfolioFolderNode::GetName
WString GetName() const
Get name of current folder node.
foxit::FS_HANDLE
void * FS_HANDLE
Handle type.
Definition: fs_basictypes.h:213
foxit::pdf::FileSpec
Definition: fs_filespec.h:38
foxit::pdf::portfolio::PortfolioFolderNode::~PortfolioFolderNode
~PortfolioFolderNode()
Destructor.
Definition: fs_portfolio.h:138
foxit::pdf::portfolio::SchemaField::SetSubtypeName
void SetSubtypeName(const char *subtype_name)
Set the subtype name string.
foxit::DateTime
Definition: fs_basictypes.h:484
IFX_FileStream
File stream interface, reading & writing.
Definition: fx_stream.h:692
foxit::pdf::portfolio::PortfolioFolderNode::GetModifiedDateTime
DateTime GetModifiedDateTime() const
Get the last modified date time.
foxit::pdf::portfolio::SchemaField::SetDisplayName
void SetDisplayName(const wchar_t *display_name)
Set the display name.
fs_common.h
Header file for common definitions and classes.
foxit::pdf::portfolio::PortfolioNode::e_TypeFolder
Portfolio node type: folder.
Definition: fs_portfolio.h:56
foxit::pdf::portfolio::PortfolioNode::e_TypeUnknown
Unknown portfolio node type.
Definition: fs_portfolio.h:54
foxit::pdf::portfolio::PortfolioFolderNode::GetSortedSubNodes
PortfolioNodeArray GetSortedSubNodes() const
Get sub nodes array, which has been sorted according to sorting order and specified field name define...
foxit::pdf::portfolio::SchemaField::GetDisplayName
WString GetDisplayName() const
Get the display name.
foxit::pdf::portfolio::PortfolioNodeArray
Definition: fs_portfolio.h:118
foxit::pdf::portfolio::PortfolioFileNode
Definition: fs_portfolio.h:266
foxit::pdf::portfolio::PortfolioFolderNode::GetDescription
WString GetDescription() const
Get description.
foxit::pdf::portfolio::PortfolioFolderNode::IsRoot
bool IsRoot() const
Check if current folder node represents root node.
foxit::pdf::portfolio::SchemaField::~SchemaField
~SchemaField()
Destructor.
foxit::pdf::portfolio::PortfolioFolderNode::AddSubFolder
PortfolioFolderNode AddSubFolder(const wchar_t *folder_name)
Add a new sub folder.
foxit::pdf::portfolio::PortfolioFolderNode
Definition: fs_portfolio.h:128
foxit::pdf::portfolio::SchemaField::GetSubtypeName
String GetSubtypeName() const
Get the subtype name string.
foxit::pdf::portfolio::SchemaField::operator==
bool operator==(const SchemaField &other) const
Equal operator.
foxit::pdf::portfolio::PortfolioFileNode::GetFileSpec
FileSpec GetFileSpec() const
Get the related file specification object which is used to access an embedded file information and da...
CFX_ByteString
BYTE STRING CLASS.
Definition: fx_string.h:317
foxit::pdf::portfolio::Portfolio
Definition: fs_portfolio.h:484
foxit::pdf::portfolio::PortfolioFolderNode::PortfolioFolderNode
PortfolioFolderNode(const PortfolioNode &other)
Constructor, with parent class object.
foxit::pdf::portfolio::SchemaField::SetKeyName
void SetKeyName(const char *key_name)
Set the key name string.
foxit::pdf::portfolio::SchemaField
Definition: fs_portfolio.h:303
foxit::pdf::portfolio::PortfolioFolderNode::RemoveSubNode
void RemoveSubNode(const PortfolioNode &sub_node)
Remove a sub node.
foxit::pdf::portfolio::SchemaFieldArray
Definition: fs_portfolio.h:476
operator==
bool operator==(const char *str1, const CFX_ByteString &str2)
Check if two byte strings are equal.
Definition: fs_basictypes.h:128
foxit::pdf::portfolio::PortfolioNode::operator=
PortfolioNode & operator=(const PortfolioNode &other)
Assign operator.
foxit::pdf::portfolio::PortfolioFolderNode::SetDescription
void SetDescription(const wchar_t *description)
Set description.
foxit::pdf::portfolio::SchemaField::SetVisibility
void SetVisibility(bool is_visible)
Set the initial visibility of current field in application.
foxit
Foxit namespace.
Definition: fs_taggedpdf.h:27
foxit::pdf::portfolio::PortfolioNode::Type
Type
Enumeration for portfolio node type.
Definition: fs_portfolio.h:52
fs_filespec.h
Header file for file specification related definitions and classes.
operator!=
bool operator!=(const char *str1, const CFX_ByteString &str2)
Check if two byte strings are not equal.
Definition: fs_basictypes.h:140
foxit::pdf::portfolio::PortfolioFolderNode::GetCreationDateTime
DateTime GetCreationDateTime() const
Get the creation date time.
foxit::pdf::portfolio::PortfolioNode::~PortfolioNode
~PortfolioNode()
Destructor.
fs_pdfdoc.h
Header file for PDF document related definitions and classes.
foxit::pdf::portfolio::PortfolioFileNode::GetKeyName
WString GetKeyName() const
Get the key name of the related file specification object.
foxit::pdf::portfolio::SchemaField::IsEmpty
bool IsEmpty() const
Check whether current object is empty or not.
foxit::pdf::portfolio::PortfolioFolderNode::AddPDFDoc
PortfolioFileNode AddPDFDoc(const PDFDoc &pdf_doc, const wchar_t *file_name)
Add an loaded PDF document to be a sub node.
NULL
#define NULL
The null-pointer value.
Definition: fx_system.h:792
foxit::pdf::portfolio::SchemaField::SchemaField
SchemaField()
Constructor.
foxit::pdf::portfolio::SchemaField::operator=
SchemaField & operator=(const SchemaField &other)
Assign operator.
foxit::pdf::PDFDoc
Definition: fs_pdfdoc.h:776
foxit::pdf::portfolio::SchemaField::operator!=
bool operator!=(const SchemaField &other) const
Not equal operator.
foxit::pdf::portfolio::PortfolioFolderNode::AddFile
PortfolioFileNode AddFile(const wchar_t *file_path)
Add a file (specified by file path) to be a sub node.
foxit::pdf::portfolio::PortfolioNode::e_TypeFile
Portfolio node type: file.
Definition: fs_portfolio.h:58
foxit::pdf::portfolio::PortfolioNode::operator==
bool operator==(const PortfolioNode &other) const
Equal operator.
foxit::pdf::portfolio::PortfolioNode::PortfolioNode
PortfolioNode(const PortfolioNode &other)
Constructor, with another portfolio node object.
foxit::pdf::portfolio::PortfolioNode::GetNodeType
Type GetNodeType() const
Get node type.
CFX_WideString
WIDE STRING CLASS.
Definition: fx_string.h:1461
foxit::pdf::portfolio::PortfolioFileNode::PortfolioFileNode
PortfolioFileNode(const PortfolioNode &other)
Constructor, with parent class object.
foxit::pdf::portfolio::PortfolioNode
Definition: fs_portfolio.h:45
foxit::pdf::portfolio::PortfolioNode::IsEmpty
bool IsEmpty() const
Check whether current object is empty or not.
foxit::Base
Definition: fs_basictypes.h:451
foxit::pdf::portfolio::PortfolioFileNode::~PortfolioFileNode
~PortfolioFileNode()
Destructor.
Definition: fs_portfolio.h:276
foxit::pdf::portfolio::SchemaField::GetKeyName
String GetKeyName() const
Get the key name string.