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 {
39 class PortfolioNode : public Base {
40  public:
46  typedef enum _Type {
53  } Type;
54 
60  PortfolioNode(const PortfolioNode& other);
71 
79  bool operator == (const PortfolioNode& other) const;
87  bool operator != (const PortfolioNode& other) const;
88 
96  bool IsEmpty() const;
97 
104  Type GetNodeType() const;
105 
106  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
107  explicit PortfolioNode(FS_HANDLE handle = NULL);
108 
109 };
110 
113 
114 class PortfolioFileNode;
115 
122 class PortfolioFolderNode FS_FINAL : public PortfolioNode {
123  public:
129  explicit PortfolioFolderNode(const PortfolioNode& other);
130 
133 
140  bool IsRoot() const;
141 
148  WString GetName() const;
149 
161  PortfolioFileNode AddFile(const wchar_t* file_path);
175  PortfolioFileNode AddFile(foxit::common::file::StreamCallback* file_stream, const wchar_t* file_name);
189  PortfolioFileNode AddPDFDoc(const PDFDoc& pdf_doc, const wchar_t* file_name);
190 
198  PortfolioFolderNode AddSubFolder(const wchar_t* folder_name);
199 
207  void RemoveSubNode(const PortfolioNode& sub_node);
208 
218 
234 
240  WString GetDescription() const;
248  void SetDescription(const wchar_t* description);
249 
250  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
251  explicit PortfolioFolderNode(FS_HANDLE handle = NULL);
252 
253 };
254 
260 class PortfolioFileNode FS_FINAL : public PortfolioNode {
261  public:
267  explicit PortfolioFileNode(const PortfolioNode& other);
268 
271 
277  FileSpec GetFileSpec() const;
278 
287  WString GetKeyName() const;
288 
289  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
290  explicit PortfolioFileNode(FS_HANDLE handle = NULL);
291 
292 };
293 
297 class SchemaField FS_FINAL : public Base {
298  public:
302  SchemaField();
303 
309  SchemaField(const SchemaField& other);
317  SchemaField& operator = (const SchemaField& other);
318 
326  bool operator == (const SchemaField& other) const;
334  bool operator != (const SchemaField& other) const;
335 
343  bool IsEmpty() const;
344 
346  ~SchemaField();
347 
360  String GetKeyName() const;
361 
376  void SetKeyName(const char* key_name);
377 
400  String GetSubtypeName() const;
426  void SetSubtypeName(const char* subtype_name);
427 
435  WString GetDisplayName() const;
445  void SetDisplayName(const wchar_t* display_name);
446 
453  bool IsVisible() const;
462  void SetVisibility(bool is_visible);
463 
464  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
465  explicit SchemaField(FS_HANDLE handle);
466 
467 };
468 
470 FSDK_DEFINE_ARRAY(SchemaFieldArray, SchemaField)
471 
472 
478 class Portfolio FS_FINAL : public Base {
479  public:
485  typedef enum _InitialViewMode {
487  e_InitialViewUnknownMode = 0,
492  e_InitialViewDetailMode = 1,
497  e_InitialViewTileMode = 2,
501  e_InitialViewHidden = 3
502  } InitialViewMode;
503 
504 
514  static Portfolio CreatePortfolio();
515 
526  static Portfolio CreatePortfolio(const foxit::pdf::PDFDoc& portfolio_pdf_doc);
527 
533  Portfolio(const Portfolio& other);
541  Portfolio& operator = (const Portfolio& other);
542 
550  bool operator == (const Portfolio& other) const;
558  bool operator != (const Portfolio& other) const;
559 
567  bool IsEmpty() const;
568 
570  ~Portfolio();
571 
577  PDFDoc GetPortfolioPDFDoc() const;
578 
587  PortfolioNode GetRootNode() const;
588 
594  InitialViewMode GetInitialViewMode() const;
603  void SetInitialViewMode(InitialViewMode mode);
604 
611  bool IsSortedInAscending() const;
621  void SetSortingOrder(bool use_ascending_order);
627  String GetSortingFieldKeyName() const;
635  void SetSortingFieldKeyName(const char* name);
636 
645  WString GetInitialFileSpecKeyName() const;
657  void SetInitialFileSpecKeyName(const wchar_t* name);
658 
666  SchemaFieldArray GetSchemaFields() const;
677  void SetSchemaFields(const SchemaFieldArray& field_array);
678 
679  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
680  explicit Portfolio(FS_HANDLE handle = NULL);
681 
682 };
683 
684 } // namespace portfolio
685 } // namespace pdf
686 } // namespace foxit
687 
688 #endif // FS_PORTFOLIO_H_
689 
Type GetNodeType() const
Get node type.
void SetDescription(const wchar_t *description)
Set description.
~PortfolioFolderNode()
Destructor.
Definition: fs_portfolio.h:132
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:440
Unknown portfolio node type.
Definition: fs_portfolio.h:48
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:1452
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:50
Definition: fs_pdfdoc.h:508
void SetDisplayName(const wchar_t *display_name)
Set the display name.
Definition: fs_portfolio.h:478
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:122
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:270
File stream interface, reading & writing.
Definition: fx_stream.h:669
Definition: fs_portfolio.h:39
PortfolioFolderNode(const PortfolioNode &other)
Constructor, with parent class object.
Definition: fs_portfolio.h:260
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:214
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:470
Definition: fs_basictypes.h:407
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:46
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:112
Portfolio node type: file.
Definition: fs_portfolio.h:52
#define NULL
The null-pointer value.
Definition: fx_system.h:780
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:297
bool IsVisible() const
Check if current field is initially visible in application or not.