Develop and Download Open Source Software

Browse CVS Repository

Diff of /malonnote/mnModel.h

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1.1.1 by maloninc, Thu Jul 28 03:25:06 2005 UTC revision 1.22 by maloninc, Mon Oct 23 08:00:09 2006 UTC
# Line 4  Line 4 
4  #include <wx/wx.h>  #include <wx/wx.h>
5  #include <wx/treebase.h>  #include <wx/treebase.h>
6    
7  #define MAX_WIKI_TEXT_SIZE 10000  #include "config.h"
8    
9    #define MAX_WIKI_TEXT_SIZE (1048576*5)
10    #define MAX_TOKEN          32
11  #define MAX_BUF_SIZE       1024  #define MAX_BUF_SIZE       1024
12  #define EXT_TAG             ".txt"  #define EXT_TAG             ".txt"
13  #define DATE_TAG            ":''DATE'':"  #define DATE_TAG            ":''DATE'':"
14  #define NEW_DATA            DATE_TAG " %Y/%m/%d %H:%M:%S\n\n:''TYPE'': memo\n----\n"  #define TYPE_TAG            ":''TYPE'':"
15    #define NEW_DATA            DATE_TAG " %Y/%m/%d %H:%M:%S\n\n" TYPE_TAG " memo\n---------------------------------------------------------\n"
16    #define NEW_DATA_TEMPLATE   "new.template"
17    
18    #define ALLMEMO_TAG         "malon-all"
19    #define TYPESEARCH_TAG      "malon-type:"
20    
21  #define CODE_SET_EUC_JP     "eucJP"  #define CODE_SET_EUC_JP     "eucJP"
22  #ifdef __WXMAC__  #ifdef __WXMAC__
23          #define CODE_SET_SYSTEM "SJIS"          #define CODE_SET_SYSTEM "CP932"
24    #endif
25    #ifdef __WXCOCOA__
26            #define CODE_SET_SYSTEM "CP932"
27  #endif  #endif
28  #ifdef __WXMSW__  #ifdef __WXMSW__
29          #define CODE_SET_SYSTEM "SJIS"          #define CODE_SET_SYSTEM "CP932"
30  #endif  #endif
31  #ifdef __WXMOTIF__  #ifdef __WXMOTIF__
32          #define CODE_SET_SYSTEM "eucJP"          #define CODE_SET_SYSTEM "eucJP"
33  #endif  #endif
34  #ifdef __WXGTK__  #ifdef __WXGTK__
35          #define CODE_SET_SYSTEM "eucJP"          #define CODE_SET_SYSTEM "euc-jp"
36  #endif  #endif
37  #ifdef __WXX11__  #ifdef __WXX11__
38          #define CODE_SET_SYSTEM "eucJP"          #define CODE_SET_SYSTEM "eucJP"
39  #endif  #endif
40    
41    #define MAC_BACKSLASH 0x80
42    
43    
44  class WikiData : wxTreeItemData{  class WikiData : wxTreeItemData{
45    
46  public:  public:
47          WikiData(wxString* dataDir, const char* fileName, FILE* fp);          WikiData(wxString* dataDir, wxString* fileName);
48          WikiData(wxString* dataDir);          WikiData(wxString* dataDir);
49          ~WikiData();          ~WikiData();
50          const wxString* getFileName();          const wxString* getFileName();
51          const wxString* getSubject();          const wxString* getSubject();
52            const wxString* getOldSubject();
53          const wxString* getDate();          const wxString* getDate();
54      const wxString* getText();      const wxString* getText();
55      void  modText(wxString* text);      void  modText(wxString* text);
56      void  modSubject(wxString* newName);      void  modSubject(wxString* newName);
57          void  save();          void  save();
58          void  removeDataFile();          void  removeDataFile();
59            void  setOldSubjectFromCurrent();
60    
61  private:  private:
62          wxString* subject;          wxString* subject;
63            wxString* oldSubject;
64          wxString* dataDirName;          wxString* dataDirName;
65          wxString* fileName;          wxString* fileName;
66          wxString* date;          wxString* date;
67          wxString* text;          wxString* text;
68            bool      isWriteToFile;
69  };  };
70    
71    /* Search Result List */
72  WX_DECLARE_LIST(WikiData, WikiList);  WX_DECLARE_LIST(WikiData, WikiList);
73    
74    /* Search Result Hash (Key is search string) */
75    WX_DECLARE_STRING_HASH_MAP(WikiList*, WikiHash);
76    
77    
78  class mnModel {  class mnModel {
# Line 62  class mnModel { Line 80  class mnModel {
80  public:  public:
81      mnModel(const char* dataDir);      mnModel(const char* dataDir);
82      ~mnModel();      ~mnModel();
83            bool makeSearchToken(const char* searchStr, char* tokenList[]);
84            bool matchWithToken(wxString* fileName, char* tokenList[]);
85      WikiList* search(const char* searchStr);      WikiList* search(const char* searchStr);
86            void readAll(bool progBarFlag);
87            void group();
88            bool normalSearch(char* tokenList[], FILE*fp, char* decodeFileNameBuf);
89            bool typeSearch(char* typeStr, FILE*fp);
90      void addWikiData(WikiData* wikiData);      void addWikiData(WikiData* wikiData);
91          void addSearchStr(wxString* searchStr);          bool addSearchStr(wxString* searchStr);
92            void addSearchList(wxString* searchStr, WikiList* list);
93          void removeSearchStr(wxString searchStr);          void removeSearchStr(wxString searchStr);
94          void modSearchStr(wxString* oldStr, wxString* newStr);          void modSearchStr(wxString* oldStr, wxString* newStr);
95          const wxArrayString* getSearchStrList();          const wxArrayString* getSearchStrList();
96            const WikiList* getSearchResultList(wxString* searchStr);
97            void addSearchResultList(wxString* searchStr, WikiData* addData);
98            bool delSearchResultList(wxString* searchStr, WikiData* delData);
99          WikiData* newWikiData();          WikiData* newWikiData();
100            const wxString* getWikiDataDir();
101            void clearSearchStrList();
102            void clearSearchResultList();
103  private:  private:
104      wxString*      wikiDataDir;      wxString*      wikiDataDir;
105          wxArrayString* searchStrList;          wxArrayString* searchStrList;
106            WikiHash       wikiHash;
107  };  };
108    
109    

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.22

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26