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;
38 class PortfolioFileNode;
39 class SchemaField;
40 class Portfolio;
41 
45 class PortfolioNode : public Base {
46  public:
52  typedef enum _Type {
59  } Type;
60 
66  PortfolioNode(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 
119 
120 class PortfolioFileNode;
121 
128 class PortfolioFolderNode FS_FINAL : public PortfolioNode {
129  public:
135  explicit PortfolioFolderNode(const PortfolioNode& other);
136 
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 
224 
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 
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 
Type GetNodeType() const
Get node type.
void SetDescription(const wchar_t *description)
Set description.
~PortfolioFolderNode()
Destructor.
Definition: fs_portfolio.h:138
void RemoveSubNode(const PortfolioNode &sub_node)
Remove a sub node.
WString GetDisplayName() const
Get the display name.
Header file for PDF document related definitions and classes.
WString GetKeyName() const
Get the key name of the related file specification object.
Definition: fs_basictypes.h:484
Unknown portfolio node type.
Definition: fs_portfolio.h:54
FileSpec GetFileSpec() const
Get the related file specification object which is used to access an embedded file information and da...
Header file for file specification related definitions and classes.
WIDE STRING CLASS.
Definition: fx_string.h:1461
bool operator !=(const PortfolioNode &other) const
Not equal operator.
PortfolioFileNode AddPDFDoc(const PDFDoc &pdf_doc, const wchar_t *file_name)
Add an loaded PDF document to be a sub node.
Portfolio node type: folder.
Definition: fs_portfolio.h:56
Definition: fs_pdfdoc.h:776
void SetDisplayName(const wchar_t *display_name)
Set the display name.
Definition: fs_portfolio.h:484
bool operator==(const char *str1, const CFX_ByteString &str2)
Check if two byte strings are equal.
Definition: fs_basictypes.h:128
Definition: fs_portfolio.h:128
void SetKeyName(const char *key_name)
Set the key name string.
bool IsRoot() const
Check if current folder node represents root node.
~PortfolioFileNode()
Destructor.
Definition: fs_portfolio.h:276
File stream interface, reading & writing.
Definition: fx_stream.h:692
Definition: fs_portfolio.h:45
PortfolioFolderNode(const PortfolioNode &other)
Constructor, with parent class object.
Definition: fs_portfolio.h:266
PortfolioFileNode(const PortfolioNode &other)
Constructor, with parent class object.
PortfolioFolderNode AddSubFolder(const wchar_t *folder_name)
Add a new sub folder.
void * FS_HANDLE
Handle type.
Definition: fs_basictypes.h:213
String GetKeyName() const
Get the key name string.
WString GetName() const
Get name of current folder node.
Header file for common definitions and classes.
Definition: fs_portfolio.h:476
Definition: fs_basictypes.h:451
Definition: fs_filespec.h:38
String GetSubtypeName() const
Get the subtype name string.
PortfolioNodeArray GetSortedSubNodes() const
Get sub nodes array, which has been sorted according to sorting order and specified field name define...
Type
Enumeration for portfolio node type.
Definition: fs_portfolio.h:52
void SetSubtypeName(const char *subtype_name)
Set the subtype name string.
bool IsEmpty() const
Check whether current object is empty or not.
bool operator==(const PortfolioNode &other) const
Equal operator.
bool IsEmpty() const
Check whether current object is empty or not.
Foxit namespace.
Definition: fs_taggedpdf.h:27
PortfolioNode(const PortfolioNode &other)
Constructor, with another portfolio node object.
bool operator==(const SchemaField &other) const
Equal operator.
PortfolioNode & operator=(const PortfolioNode &other)
Assign operator.
BYTE STRING CLASS.
Definition: fx_string.h:317
SchemaField & operator=(const SchemaField &other)
Assign operator.
Definition: fs_portfolio.h:118
Portfolio node type: file.
Definition: fs_portfolio.h:58
#define NULL
The null-pointer value.
Definition: fx_system.h:792
PortfolioFileNode AddFile(const wchar_t *file_path)
Add a file (specified by file path) to be a sub node.
WString GetDescription() const
Get description.
DateTime GetModifiedDateTime() const
Get the last modified date time.
void SetVisibility(bool is_visible)
Set the initial visibility of current field in application.
bool operator !=(const SchemaField &other) const
Not equal operator.
DateTime GetCreationDateTime() const
Get the creation date time.
Definition: fs_portfolio.h:303
bool IsVisible() const
Check if current field is initially visible in application or not.