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.15 by maloninc, Tue Sep 20 06:29:53 2005 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    #include "config.h"
8    
9  #define MAX_WIKI_TEXT_SIZE 10000  #define MAX_WIKI_TEXT_SIZE 10000
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    
17    #define ALLMEMO_TAG         "malon-all"
18    #define TYPESEARCH_TAG      "malon-type:"
19    
20  #define CODE_SET_EUC_JP     "eucJP"  #define CODE_SET_EUC_JP     "euc-jp"
21  #ifdef __WXMAC__  #ifdef __WXMAC__
22          #define CODE_SET_SYSTEM "SJIS"          #define CODE_SET_SYSTEM "CP932"
23    #endif
24    #ifdef __WXCOCOA__
25            #define CODE_SET_SYSTEM "CP932"
26  #endif  #endif
27  #ifdef __WXMSW__  #ifdef __WXMSW__
28          #define CODE_SET_SYSTEM "SJIS"          #define CODE_SET_SYSTEM "CP932"
29  #endif  #endif
30  #ifdef __WXMOTIF__  #ifdef __WXMOTIF__
31          #define CODE_SET_SYSTEM "eucJP"          #define CODE_SET_SYSTEM "eucJP"
32  #endif  #endif
33  #ifdef __WXGTK__  #ifdef __WXGTK__
34          #define CODE_SET_SYSTEM "eucJP"          #define CODE_SET_SYSTEM "euc-jp"
35  #endif  #endif
36  #ifdef __WXX11__  #ifdef __WXX11__
37          #define CODE_SET_SYSTEM "eucJP"          #define CODE_SET_SYSTEM "eucJP"
38  #endif  #endif
39    
40    #define MAC_BACKSLASH 0x80
41    
42    
43  class WikiData : wxTreeItemData{  class WikiData : wxTreeItemData{
44    
45  public:  public:
46          WikiData(wxString* dataDir, const char* fileName, FILE* fp);          WikiData(wxString* dataDir, wxString* fileName);
47          WikiData(wxString* dataDir);          WikiData(wxString* dataDir);
48          ~WikiData();          ~WikiData();
49          const wxString* getFileName();          const wxString* getFileName();
50          const wxString* getSubject();          const wxString* getSubject();
51            const wxString* getOldSubject();
52          const wxString* getDate();          const wxString* getDate();
53      const wxString* getText();      const wxString* getText();
54      void  modText(wxString* text);      void  modText(wxString* text);
55      void  modSubject(wxString* newName);      void  modSubject(wxString* newName);
56          void  save();          void  save();
57          void  removeDataFile();          void  removeDataFile();
58            void  setOldSubjectFromCurrent();
59    
60  private:  private:
61          wxString* subject;          wxString* subject;
62            wxString* oldSubject;
63          wxString* dataDirName;          wxString* dataDirName;
64          wxString* fileName;          wxString* fileName;
65          wxString* date;          wxString* date;
66          wxString* text;          wxString* text;
67  };  };
68    
69    /* Search Result List */
70  WX_DECLARE_LIST(WikiData, WikiList);  WX_DECLARE_LIST(WikiData, WikiList);
71    
72    /* Search Result Hash (Key is search string) */
73    WX_DECLARE_STRING_HASH_MAP(WikiList*, WikiHash);
74    
75    
76  class mnModel {  class mnModel {
# Line 62  class mnModel { Line 78  class mnModel {
78  public:  public:
79      mnModel(const char* dataDir);      mnModel(const char* dataDir);
80      ~mnModel();      ~mnModel();
81            bool makeSearchToken(const char* searchStr, char* tokenList[]);
82            bool matchWithToken(wxString* fileName, char* tokenList[]);
83      WikiList* search(const char* searchStr);      WikiList* search(const char* searchStr);
84            void group();
85            bool normalSearch(char* tokenList[], FILE*fp, char* decodeFileNameBuf);
86            bool typeSearch(char* typeStr, FILE*fp);
87      void addWikiData(WikiData* wikiData);      void addWikiData(WikiData* wikiData);
88          void addSearchStr(wxString* searchStr);          bool addSearchStr(wxString* searchStr);
89            void addSearchList(wxString* searchStr, WikiList* list);
90          void removeSearchStr(wxString searchStr);          void removeSearchStr(wxString searchStr);
91          void modSearchStr(wxString* oldStr, wxString* newStr);          void modSearchStr(wxString* oldStr, wxString* newStr);
92          const wxArrayString* getSearchStrList();          const wxArrayString* getSearchStrList();
93            const WikiList* getSearchResultList(wxString* searchStr);
94            void addSearchResultList(wxString* searchStr, WikiData* addData);
95            bool delSearchResultList(wxString* searchStr, WikiData* delData);
96          WikiData* newWikiData();          WikiData* newWikiData();
97            const wxString* getWikiDataDir();
98            void clearSearchStrList();
99            void clearSearchResultList();
100  private:  private:
101      wxString*      wikiDataDir;      wxString*      wikiDataDir;
102          wxArrayString* searchStrList;          wxArrayString* searchStrList;
103            WikiHash       wikiHash;
104  };  };
105    
106    

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

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