Develop and Download Open Source Software

Browse CVS Repository

Contents of /malonnote/mnModel.h

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


Revision 1.13 - (show annotations) (download) (as text)
Thu Sep 15 09:20:48 2005 UTC (18 years, 6 months ago) by maloninc
Branch: MAIN
CVS Tags: dev_1_3-0005
Changes since 1.12: +10 -1 lines
File MIME type: text/x-chdr
implement effective update, but it's incomplete. (9/15)

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

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