OSDN Git Service

・TThreadItem クラス、およびクラスの受け渡し処理を追加。
[gikonavigoeson/gikonavi.git] / Setting.pas
1 unit Setting;
2
3 interface
4
5 uses
6         SysUtils, Classes, Graphics, Forms, Math, IniFiles, UCryptAuto, UBase64,
7         ComCtrls;
8
9 const
10         MAIN_COOLBAND_COUNT = 4;                //\83\81\83C\83\93CoolBand\82Ì\90\94
11         LIST_COOLBAND_COUNT = 2;                //\94ÂCoolBand\82Ì\90\94
12         BROWSER_COOLBAND_COUNT = 3;     //\83u\83\89\83E\83UCoolBand\82Ì\90\94
13
14 type
15         TGikoTabPosition = (gtpTop, gtpBottom);                                                         // \83^\83u\88Ê\92u
16         TGikoTabAppend = (gtaFirst, gtpLast);                                                                   // \83^\83u\92Ç\89Á\88Ê\92u
17         TGikoTabStyle = (gtsTab, gtsButton, gtsFlat);                                   // \83^\83u\83X\83^\83C\83\8b
18         TGikoListOrientation = (gloHorizontal, gloVertical);    // \83\8a\83X\83g\90\82\92¼\81E\90\85\95½
19         TGikoListState = (glsMax, glsNormal, glsMin);                                   // \83\8a\83X\83g\83T\83C\83Y\8fó\91Ô
20                                                                                                                                                                                                                                 // \83|\83b\83v\83A\83b\83v\95\\8e¦\88Ê\92u
21         TGikoPopupPosition = (gppRightTop, gppTop, gppLeftTop,
22                                                                                                 gppRight, gppCenter, gppLeft,
23                                                                                                 gppRightBottom, gppBottom, gppLeftBottom);
24                                                                                                                                                                                                                                 //\83v\83\8c\83r\83\85\81[\83T\83C\83Y
25         TGikoPreviewSize = (gpsXLarge, gpsLarge, gpsMedium, gpsSmall, gpsXSmall);
26
27         //CoolBar\90Ý\92è\83\8c\83R\81[\83h
28         TCoolSet = record
29                 FCoolID: Integer;
30                 FCoolWidth: Integer;
31                 FCoolBreak: Boolean;
32         end;
33
34         TSetting = class(TObject)
35         private
36                 //\8eó\90M\83o\83b\83t\83@\83T\83C\83Y
37                 FRecvBufferSize: Integer;
38                 //HTTP1.1\8eg\97p
39                 FProtocol: Boolean;
40                 //\83v\83\8d\83L\83V\90Ú\91±HTTP1.1\8eg\97p
41                 FProxyProtocol: Boolean;
42
43                 //\83v\83\8d\83L\83V\81i\93Ç\8d\9e\97p\81j
44                 FReadProxy: Boolean;
45                 FReadProxyAddress: string;
46                 FReadProxyPort: Integer;
47                 FReadProxyUserID: string;
48                 FReadProxyPassword: string;
49
50                 //\83v\83\8d\83L\83V\81i\8f\91\8d\9e\97p\81j
51                 FWriteProxy: Boolean;
52                 FWriteProxyAddress: string;
53                 FWriteProxyPort: Integer;
54                 FWriteProxyUserID: string;
55                 FWriteProxyPassword: string;
56
57                 //\83L\83\83\83r\83l\83b\83g
58                 FCabinetFontName: string;
59                 FCabinetFontSize: Integer;
60                 FCabinetFontBold: Boolean;
61                 FCabinetFontItalic: Boolean;
62                 FCabinetFontColor: TColor;
63                 FCabinetBackColor: TColor;
64
65                 //\83\8a\83X\83g
66                 FListFontName: string;
67                 FListFontSize: Integer;
68                 FListFontBold: Boolean;
69                 FListFontItalic: Boolean;
70                 FListFontColor: TColor;
71                 FListBackColor: TColor;
72
73                 //\83u\83\89\83E\83U
74                 FBrowserFontName: string;                       // ''...default
75                 FBrowserFontSize: Integer;              // 0...default
76                 FBrowserFontBold: Integer;              // 0...default, -1...False, 1...True
77                 FBrowserFontItalic: Integer;    // \8fã\82É\93¯\82
78                 FBrowserFontColor: Integer;     // -1...default
79                 FBrowserBackColor: Integer;     // \8fã\82É\93¯\82
80
81                 //\83G\83f\83B\83^
82                 FEditorFontName: string;
83                 FEditorFontSize: Integer;
84                 FEditorFontBold: Boolean;
85                 FEditorFontItalic: Boolean;
86                 FEditorFontColor: TColor;
87                 FEditorBackColor: TColor;
88
89                 //\83^\83u\83t\83H\83\93\83g
90                 FBrowserTabFontName: string;
91                 FBrowserTabFontSize: Integer;
92                 FBrowserTabFontBold: Boolean;
93                 FBrowserTabFontItalic: Boolean;
94
95                 //\83q\83\93\83g\83E\83B\83\93\83h\83E
96                 FHintFontName: string;
97                 FHintFontSize: Integer;
98                 //FHintFontBold: Boolean;
99                 //FHintFontItalic: Boolean;
100                 FHintFontColor: TColor;
101                 FHintBackColor: TColor;
102
103
104                 //\83E\83B\83\93\83h\83E\83T\83C\83Y
105                 FWindowTop: Integer;
106                 FWindowLeft: Integer;
107                 FWindowHeight: Integer;
108                 FWindowWidth: Integer;
109                 FWindowMax: Boolean;
110                 //\83\8a\83X\83g\83r\83\85\81[\83X\83^\83C\83\8b
111                 FListStyle: TViewStyle;
112
113                 //\83c\81[\83\8b\83o\81[\95\\8e¦
114                 FStdToolBarVisible: Boolean;
115                 FAddressBarVisible: Boolean;
116                 FLinkBarVisible: Boolean;
117                 FListToolBarVisible: Boolean;
118                 FListNameBarVisible: Boolean;
119                 FBrowserToolBarVisible: Boolean;
120                 FBrowserNameBarVisible: Boolean;
121
122                 //\83u\83\89\83E\83U\83^\83u
123                 FBrowserTabVisible: Boolean;
124                 FBrowserTabPosition: TGikoTabPosition;
125                 FBrowserTabAppend: TGikoTabAppend;
126                 FBrowserTabStyle: TGikoTabStyle;
127
128                 //\83\81\83b\83Z\81[\83W\83o\81[
129                 FMessageBarVisible: Boolean;
130                 FMessegeBarHeight: Integer;
131
132                 //\83X\83e\81[\83^\83X\83o\81[
133                 FStatusBarVisible: Boolean;
134
135                 //\83L\83\83\83r\83l\83b\83g\89Â\8e\8b\81E\83T\83C\83Y
136                 FCabinetVisible: Boolean;
137                 FCabinetWidth: Integer;
138
139                 //\83\8a\83X\83g\81E\83u\83\89\83E\83U\83T\83C\83Y
140                 FListOrientation: TGikoListOrientation;
141                 FListHeight: Integer;
142                 FListHeightState: TGikoListState;
143                 FListWidth: Integer;
144                 FListWidthState: TGikoListState;
145 //              FListHeightMax: Boolean;
146 //              FListWidthMax: Boolean;
147
148                 //\91\97\90M\97p\96¼\91O\81E\83\81\81[\83\8b
149                 FNameList: TStringList;
150                 FMailList: TStringList;
151
152                 //\83G\83f\83B\83^\81[\83E\83B\83\93\83h\83E\83T\83C\83Y
153                 FEditWindowTop: Integer;
154                 FEditWindowLeft: Integer;
155                 FEditWindowHeight: Integer;
156                 FEditWindowWidth: Integer;
157                 FEditWindowMax: Boolean;
158
159                 //\83\8a\83X\83g\94Ô\8d\86\95\\8e¦
160                 FListViewNo: Boolean;
161                 //CSS\95\\8e¦
162                 FUseCSS: Boolean;
163                 //CSS\83t\83@\83C\83\8b\96¼
164                 FCSSFileName: string;
165                 //mail\97\93\95\\8e¦
166                 FShowMail: Boolean;
167         //\8bN\93®\8e\9e\8dÅ\90V100\83\8c\83X\95\\8e¦
168         FOnlyAHundredRes : Boolean;
169                 //\94ñ\83A\83N\83e\83B\83u\8e\9e\83\8c\83X\83|\83b\83v\83A\83b\83v\95\\8e¦
170                 FUnActivePopup: Boolean;
171                 //\83\8c\83X\83|\83b\83v\83A\83b\83v\83w\83b\83_\81[\83{\81[\83\8b\83h
172                 FResPopupHeaderBold: Boolean;
173
174                 //\83\8d\83O\83t\83H\83\8b\83_
175                 FLogFolder: string;
176                 FNewLogFolder: string;
177
178                 //\83\8a\83X\83g\83J\83\89\83\80\83w\83b\83_\81[\83T\83C\83Y
179                 FBBSColumnWidth: array[0..0] of Integer;
180                 FCategoryColumnWidth: array[0..3] of Integer;
181                 FBoardColumnWidth: array[0..6] of Integer;
182
183                 //\8di\8d\9e\82Ý\95\8e\9a\97ñ
184                 FSelectTextList: TStringList;
185
186                 //\94Â\88ê\97\97URL
187                 //FBoardURL2ch: string;
188         FBoardURLs: TStringList;
189         FBoardURLSelected: Integer;
190
191                 //\83\86\81[\83UID\81E\83p\83X\83\8f\81[\83h
192                 FUserID: string;
193                 FPassword: string;
194                 FAutoLogin: Boolean;
195
196                 //URL\83N\83\8a\83b\83N\8e\9e\8bN\93®\83A\83v\83\8a
197                 FURLApp: Boolean;
198                 FURLAppFile: string;
199
200                 //mailto\83N\83\8a\83b\83N\8e\9e\93®\8dì
201                 FOpenMailer: Boolean;
202
203                 //\8dí\8f\9c\8am\94F
204                 FDeleteMsg: Boolean;
205
206                 //CoolBar\81i\83\81\83C\83\93\81E\94Â\81E\83u\83\89\83E\83U\81j
207                 FMainCoolBar: array[0..MAIN_COOLBAND_COUNT - 1] of TCoolSet;
208                 FListCoolBar: array[0..LIST_COOLBAND_COUNT - 1] of TCoolSet;
209                 FBrowserCoolBar: array[0..BROWSER_COOLBAND_COUNT - 1] of TCoolSet;
210
211                 //ToolBar Wrapable
212                 FListToolBarWrapable: Boolean;
213                 FBrowserToolBarWrapable: Boolean;
214
215                 //\83|\83b\83v\83A\83b\83v\88Ê\92u
216                 FPopupPosition: TGikoPopupPosition;
217
218                 //\83A\83h\83\8c\83X\83o\81[
219                 FURLDisplay: Boolean;
220                 FAddressBarTabStop: Boolean;
221                 FLinkAddAddressBar: Boolean;
222                 FAddressHistoryCount: Integer;
223
224                 //\89æ\91\9c\83v\83\8c\83r\83\85\81[
225                 FPreviewVisible: Boolean;
226                 FPreviewSize: TGikoPreviewSize;
227                 FPreviewWait: Integer;
228
229                 //\83X\83\8c\83b\83h\88ê\97\97\8dX\90V\83A\83C\83R\83\93\95\\8e¦
230                 FListIconVisible: Boolean;
231
232                 //\8f\91\82«\8d\9e\82Ý\8e\9e\83}\83V\83\93\8e\9e\8aÔ\8eg\97p\90Ý\92è
233                 FUseMachineTime: Boolean;
234                 FTimeAdjustSec: Integer;
235                 FTimeAdjust: Boolean;
236
237                 //\82 \82Ú\81`\82ñ
238                 FAbonDeleterlo : Boolean; //&rlo;\82ð\8dí\82é\82©
239                 FAbonReplaceul : Boolean; //<ul>\83^\83O\82ð<br>\83^\83O\82É\92u\8a·\82·\82é\82©
240                 FPopUpAbon     : Boolean; //\83\8c\83X\83|\83b\83v\83A\83b\83v\8e\9e\82Ì\82 \82Ú\81`\82ñ\97L\8cø
241                 FShowNGLinesNum : Boolean; //\8aY\93\96\82µ\82½\82m\82f\83\8f\81[\83h\83t\83@\83C\83\8b\82Ì\8ds\90\94\82ð\95\\8e¦
242                 FAddResAnchor : Boolean; //NG\83\8c\83X\82Ö\82Ì\83\8c\83X\83A\83\93\83J\81[\82ð\92Ç\89Á\82·\82é
243
244                 // \83X\83\8c\83b\83h\8di\8d\9e\83t\83B\81[\83\8b\83h\82Ì\95\9d
245                 FSelectComboBoxWidth : Integer;
246
247                 // \8dÅ\8cã\82É\91I\91ð\82³\82ê\82½\83I\83v\83V\83\87\83\93\83_\83C\83A\83\8d\83O\82Ì\83^\83u
248                 FOptionDialogTabIndex: Integer;
249
250                 // \8dÅ\8cã\82É\91I\91ð\82³\82ê\82½\83L\83\83\83r\83l\83b\83g
251                 FCabinetIndex: Integer;
252
253         //\8fI\97¹\8e\9e\82É\8am\94F\83_\83C\83A\83\8d\83O\82ð\95\\8e¦\82·\82é\82©
254         FShowDialogForEnd : Boolean;
255
256                 function GetMainCoolSet(Index: Integer): TCoolSet;
257                 function GetBoardCoolSet(Index: Integer): TCoolSet;
258                 function GetBrowserCoolSet(Index: Integer): TCoolSet;
259                 procedure SetMainCoolSet(Index: Integer; CoolSet: TCoolSet);
260                 procedure SetBoardCoolSet(Index: Integer; CoolSet: TCoolSet);
261                 procedure SetBrowserCoolSet(Index: Integer; CoolSet: TCoolSet);
262
263                 function GetBBSColumnWidth(index: Integer): Integer;
264                 function GetCategoryColumnWidth(index: Integer): Integer;
265                 function GetBoardColumnWidth(index: Integer): Integer;
266                 procedure SetBBSColumnWidth(index: Integer; value: Integer);
267                 procedure SetCategoryColumnWidth(index: Integer; value: Integer);
268                 procedure SetBoardColumnWidth(index: Integer; value: Integer);
269
270                 function GetSoundName(Index: Integer): string;
271                 function GetSoundViewName(Index: Integer): string;
272                 function GetSoundFileName(Index: Integer): string;
273                 procedure SetSoundFileName(Index: Integer; value: string);
274                 function Encrypt(s: string): string;
275                 function Decrypt(s: string): string;
276
277         procedure MakeURLIniFile();
278         protected
279
280         public
281                 constructor Create;
282                 destructor Destroy; override;
283                 function GetFileName: string;
284         function GetBoardURLFileName: string;
285                 procedure ReadSettingFile;
286         procedure ReadBoardURLsFile;
287                 procedure WriteSystemSettingFile;
288                 procedure WriteWindowSettingFile;
289                 procedure WriteNameMailSettingFile;
290                 procedure WriteFolderSettingFile();
291         procedure WriteBoardURLSettingFile;
292                 function GetSoundCount: Integer;
293                 function FindSoundFileName(Name: string): string;
294
295                 //\8eó\90M\83o\83b\83t\83@\83T\83C\83Y
296                 property RecvBufferSize: Integer read FRecvBufferSize write FRecvBufferSize;
297                 //HTTP1.1\8eg\97p
298                 property Protocol: Boolean read FProtocol write FProtocol;
299                 //\83v\83\8d\83L\83V\90Ú\91±HTTP1.1\8eg\97p
300                 property ProxyProtocol: Boolean read FProxyProtocol write FProxyProtocol;
301
302                 property ReadProxy: Boolean read FReadProxy write FReadProxy;
303                 property ReadProxyAddress: string read FReadProxyAddress write FReadProxyAddress;
304                 property ReadProxyPort: Integer read FReadProxyPort write FReadProxyPort;
305                 property ReadProxyUserID: string read FReadProxyUserID write FReadProxyUserID;
306                 property ReadProxyPassword: string read FReadProxyPassword write FReadProxyPassword;
307
308                 property WriteProxy: Boolean read FWriteProxy write FWriteProxy;
309                 property WriteProxyAddress: string read FWriteProxyAddress write FWriteProxyAddress;
310                 property WriteProxyPort: Integer read FWriteProxyPort write FWriteProxyPort;
311                 property WriteProxyUserID: string read FWriteProxyUserID write FWriteProxyUserID;
312                 property WriteProxyPassword: string read FWriteProxyPassword write FWriteProxyPassword;
313
314                 property CabinetFontName: string read FCabinetFontName write FCabinetFontName;
315                 property CabinetFontSize: Integer read FCabinetFontSize write FCabinetFontSize;
316                 property CabinetFontBold: Boolean read FCabinetFontBold write FCabinetFontBold;
317                 property CabinetFontItalic: Boolean read FCabinetFontItalic write FCabinetFontItalic;
318                 property CabinetFontColor: TColor read FCabinetFontColor write FCabinetFontColor;
319                 property CabinetBackColor: TColor read FCabinetBackColor write FCabinetBackColor;
320
321                 property ListFontName: string read FListFontName write FListFontName;
322                 property ListFontSize: Integer read FListFontSize write FListFontSize;
323                 property ListFontBold: Boolean read FListFontBold write FListFontBold;
324                 property ListFontItalic: Boolean read FListFontItalic write FListFontItalic;
325                 property ListFontColor: TColor read FListFontColor write FListFontColor;
326                 property ListBackColor: TColor read FListBackColor write FListBackColor;
327
328                 property BrowserFontName: string read FBrowserFontName write FBrowserFontName;
329                 property BrowserFontSize: Integer read FBrowserFontSize write FBrowserFontSize;
330                 property BrowserFontBold: Integer read FBrowserFontBold write FBrowserFontBold;
331                 property BrowserFontItalic: Integer read FBrowserFontItalic write FBrowserFontItalic;
332                 property BrowserFontColor: Integer read FBrowserFontColor write FBrowserFontColor;
333                 property BrowserBackColor: Integer read FBrowserBackColor write FBrowserBackColor;
334
335                 property EditorFontName: string read FEditorFontName write FEditorFontName;
336                 property EditorFontSize: Integer read FEditorFontSize write FEditorFontSize;
337                 property EditorFontBold: Boolean read FEditorFontBold write FEditorFontBold;
338                 property EditorFontItalic: Boolean read FEditorFontItalic write FEditorFontItalic;
339                 property EditorFontColor: TColor read FEditorFontColor write FEditorFontColor;
340                 property EditorBackColor: TColor read FEditorBackColor write FEditorBackColor;
341
342                 property BrowserTabFontName: string read FBrowserTabFontName write FBrowserTabFontName;
343                 property BrowserTabFontSize: Integer read FBrowserTabFontSize write FBrowserTabFontSize;
344                 property BrowserTabFontBold: Boolean read FBrowserTabFontBold write FBrowserTabFontBold;
345                 property BrowserTabFontItalic: Boolean read FBrowserTabFontItalic write FBrowserTabFontItalic;
346
347                 property HintFontName: string read FHintFontName write FHintFontName;
348                 property HintFontSize: Integer read FHintFontSize write FHintFontSize;
349                 //property HintFontBold: Boolean read FHintFontBold write FHintFontBold;
350                 //property HintFontItalic: Boolean read FHintFontItalic write FHintFontItalic;
351                 property HintFontColor: TColor read FHintFontColor write FHintFontColor;
352                 property HintBackColor: TColor read FHintBackColor write FHintBackColor;
353
354                 property WindowTop: Integer read FWindowTop write FWindowTop;
355                 property WindowLeft: Integer read FWindowLeft write FWindowLeft;
356                 property WindowHeight: Integer read FWindowHeight write FWindowHeight;
357                 property WindowWidth: Integer read FWindowWidth write FWindowWidth;
358                 property WindowMax: Boolean read FWindowMax write FWindowMax;
359                 property ListStyle: TViewStyle read FListStyle write FListStyle;
360
361                 property StdToolBarVisible: Boolean read FStdToolBarVisible write FStdToolBarVisible;
362                 property AddressBarVisible: Boolean read FAddressBarVisible write FAddressBarVisible;
363                 property LinkBarVisible: Boolean read FLinkBarVisible write FLinkBarVisible;
364                 property ListToolBarVisible: Boolean read FListToolBarVisible write FListToolBarVisible;
365                 property ListNameBarVisible: Boolean read FListNameBarVisible write FListNameBarVisible;
366                 property BrowserToolBarVisible: Boolean read FBrowserToolBarVisible write FBrowserToolBarVisible;
367                 property BrowserNameBarVisible: Boolean read FBrowserNameBarVisible write FBrowserNameBarVisible;
368
369                 property BrowserTabVisible: Boolean read FBrowserTabVisible write FBrowserTabVisible;
370                 property BrowserTabPosition: TGikoTabPosition read FBrowserTabPosition write FBrowserTabPosition;
371                 property BrowserTabAppend: TGikoTabAppend read FBrowserTabAppend write FBrowserTabAppend;
372                 property BrowserTabStyle: TGikoTabStyle read FBrowserTabStyle write FBrowserTabStyle;
373
374                 property MessageBarVisible: Boolean read FMessageBarVisible write FMessageBarVisible;
375                 property MessegeBarHeight: Integer read FMessegeBarHeight write FMessegeBarHeight;
376
377                 property StatusBarVisible: Boolean read FStatusBarVisible write FStatusBarVisible;
378
379                 property CabinetVisible: Boolean read FCabinetVisible write FCabinetVisible;
380                 property CabinetWidth: Integer read FCabinetWidth write FCabinetWidth;
381
382                 property ListOrientation: TGikoListOrientation read FListOrientation write FListOrientation;
383                 property ListHeight: Integer read FListHeight write FListHeight;
384                 property ListHeightState: TGikoListState read FListHeightState write FListHeightState;
385                 property ListWidth: Integer read FListWidth write FListWidth;
386                 property ListWidthState: TGikoListState read FListWidthState write FListWidthState;
387 //              property ListHeightMax: Boolean read FListHeightMax write FListHeightMax;
388 //              property ListWidthMax: Boolean read FListWidthMax write FListWidthMax;
389
390                 property NameList: TStringList read FNameList write FNameList;
391                 property MailList: TStringList read FMailList write FMailList;
392                 property SelectTextList: TStringList read FSelectTextList write FSelectTextList;
393
394                 property EditWindowTop: Integer read FEditWindowTop write FEditWindowTop;
395                 property EditWindowLeft: Integer read FEditWindowLeft write FEditWindowLeft;
396                 property EditWindowHeight: Integer read FEditWindowHeight write FEditWindowHeight;
397                 property EditWindowWidth: Integer read FEditWindowWidth write FEditWindowWidth;
398                 property EditWindowMax: Boolean read FEditWindowMax write FEditWindowMax;
399
400                 property ListViewNo: Boolean read FListViewNo write FListViewNo;
401                 property UseCSS: Boolean read FUseCSS write FUseCSS;
402                 property CSSFileName: string read FCSSFileName write FCSSFileName;
403
404                 property ShowMail: Boolean read FShowMail write FShowMail;
405         property OnlyAHundredRes : Boolean read FOnlyAHundredRes write FOnlyAHundredRes;
406                 property UnActivePopup: Boolean read FUnActivePopup write FUnActivePopup;
407                 property ResPopupHeaderBold: Boolean read FResPopupHeaderBold write FResPopupHeaderBold;
408
409                 property LogFolder: string read FLogFolder write FLogFolder;
410                 property NewLogFolder: string read FNewLogFolder write FNewLogFolder;
411
412                 property BBSColumnWidth[index: Integer]: Integer read GetBBSColumnWidth write SetBBSColumnWidth;
413                 property CategoryColumnWidth[index: Integer]: Integer read GetCategoryColumnWidth write SetCategoryColumnWidth;
414                 property BoardColumnWidth[index: Integer]: Integer read GetBoardColumnWidth write SetBoardColumnWidth;
415
416                 property SoundName[index: Integer]: string read GetSoundName;
417                 property SoundViewName[index: Integer]: string read GetSoundViewName;
418                 property SoundFileName[index: Integer]: string read GetSoundFileName write SetSoundFileName;
419
420                 //property BoardURL2ch: string read FBoardURL2ch write FBoardURL2ch;
421                 property BoardURLs: TStringList read FBoardURLs write FBoardURLs;
422         property BoardURLSelected: Integer read FBoardURLSelected write FBoardURLSelected;
423                 property UserID: string read FUserID write FUserID;
424                 property Password: string read FPassword write FPassword;
425                 property AutoLogin: Boolean read FAutoLogin write FAutoLogin;
426
427                 property URLApp: Boolean read FURLApp write FURLApp;
428                 property URLAppFile: string read FURLAppFile write FURLAppFile;
429
430                 property OpenMailer: Boolean read FOpenMailer write FOpenMailer;
431
432                 property DeleteMsg: Boolean read FDeleteMsg write FDeleteMsg;
433
434                 property MainCoolSet[Index: Integer]: TCoolSet read GetMainCoolSet write SetMainCoolSet;
435                 property ListCoolSet[Index: Integer]: TCoolSet read GetBoardCoolSet write SetBoardCoolSet;
436                 property BrowserCoolSet[Index: Integer]: TCoolSet read GetBrowserCoolSet write SetBrowserCoolSet;
437
438                 property ListToolBarWrapable: Boolean read FListToolBarWrapable write FListToolBarWrapable;
439                 property BrowserToolBarWrapable: Boolean read FBrowserToolBarWrapable write FBrowserToolBarWrapable;
440
441                 property PopupPosition: TGikoPopupPosition read FPopupPosition write FPopupPosition;
442
443                 property URLDisplay: Boolean read FURLDisplay write FURLDisplay;
444                 property AddressBarTabStop: Boolean read FAddressBarTabStop write FAddressBarTabStop;
445                 property LinkAddAddressBar: Boolean read FLinkAddAddressBar write FLinkAddAddressBar;
446                 property AddressHistoryCount: Integer read FAddressHistoryCount write FAddressHistoryCount;
447
448                 property PreviewVisible: Boolean read FPreviewVisible write FPreviewVisible;
449                 property PreviewSize: TGikoPreviewSize read FPreviewSize write FPreviewSize;
450                 property PreviewWait: Integer read FPreviewWait write FPreviewWait;
451
452                 property ListIconVisible: Boolean read FListIconVisible write FListIconVisible;
453
454                 property UseMachineTime: Boolean read FUseMachineTime write FUseMachineTime;
455                 property TimeAdjustSec: Integer read FTimeAdjustSec write FTimeAdjustSec;
456                 property TimeAdjust: Boolean read FTimeAdjust write FTimeAdjust;
457
458         //\82 \82Ú\81`\82ñ
459     property AbonDeleterlo : Boolean read FAbonDeleterlo write FAbonDeleterlo;
460     property AbonReplaceul : Boolean read FAbonReplaceul write FAbonReplaceul;
461     property PopUpAbon     : Boolean read FPopUpAbon write FPopUpAbon;
462         property ShowNGLinesNum : Boolean read FShowNGLinesNum write FShowNGLinesNum;
463         property AddResAnchor : Boolean read FAddResAnchor write FAddResAnchor;
464
465     // \83X\83\8c\83b\83h\8di\8d\9e\83t\83B\81[\83\8b\83h\82Ì\95\9d
466     property SelectComboBoxWidth : Integer read FSelectComboBoxWidth write FSelectComboBoxWidth;
467
468     // \8dÅ\8cã\82É\91I\91ð\82³\82ê\82½\83I\83v\83V\83\87\83\93\83_\83C\83A\83\8d\83O\82Ì\83^\83u
469     property OptionDialogTabIndex : Integer read FOptionDialogTabIndex write FOptionDialogTabIndex;
470
471     // \8dÅ\8cã\82É\91I\91ð\82³\82ê\82½\83L\83\83\83r\83l\83b\83g
472     property CabinetIndex : Integer read FCabinetIndex write FCabinetIndex;
473
474     //\8fI\97¹\8e\9e\82É\8am\94F\83_\83C\83A\83\8d\83O\82ð\95\\8e¦\82·\82é\82©
475     property ShowDialogForEnd : Boolean read FShowDialogForEnd write FShowDialogForEnd;
476
477
478         end;
479
480
481
482 implementation
483
484 type
485         TSoundName = record
486                 Name: string;
487                 ViewName: string;
488                 FileName: string;
489         end;
490
491 const
492         INI_FILE_NAME: string         = 'gikoNavi.ini';
493     BOARD_URL_INI_FILE_NAME: string = 'url.ini';
494         DEFAULT_FONT_NAME: string     = '\82l\82\82o\83S\83V\83b\83N';
495         DEFAULT_FONT_SIZE: Integer    = 9;
496         DEFAULT_FONT_COLOR: string    = 'clWindowText';
497         DEFAULT_WINDOW_COLOR: string  = 'clWindow';
498         DEFAULT_TAB_FONT_NAME: string     = '\82l\82\82o\83S\83V\83b\83N';
499         DEFAULT_TAB_FONT_SIZE: Integer    = 9;
500         DEFAULT_2CH_BOARD_URL1: string = 'http://www6.ocn.ne.jp/~mirv/2chmenu.html';
501     DEFAULT_2CH_BOARD_URL2: string = 'http://www.ff.iij4u.or.jp/~ch2/bbstable.html';
502                                                                                                                                 //'http://www.2ch.net/newbbsmenu.html';
503         GIKO_ENCRYPT_TEXT: string     = 'gikoNaviEncryptText';
504
505 var
506         SOUND_NAME: array[0..4] of TSoundName = (
507                 (Name: 'New';        ViewName: '\8eæ\93¾\90¬\8c÷';           FileName: ''),
508                 (Name: 'NewDiff';    ViewName: '\8eæ\93¾\90¬\8c÷(\8d·\95ª)';     FileName: ''),
509                 (Name: 'NoChange';   ViewName: '\96¢\8dX\90V';             FileName: ''),
510 //              (Name: 'RoundEnd';   ViewName: '\8f\84\89ñ\8fI\97¹(\8eæ\93¾\82 \82è)'; FileName: ''),
511 //              (Name: 'RoundNone';  ViewName: '\8f\84\89ñ\8fI\97¹(\8eæ\93¾\82È\82µ)'; FileName: ''),
512                 (Name: 'ResEnd';     ViewName: '\83\8c\83X\91\97\90M\8a®\97¹';       FileName: ''),
513                 (Name: 'Error';      ViewName: '\83G\83\89\81[';             FileName: ''));
514
515 //\83R\83\93\83X\83g\83\89\83N\83^
516 constructor TSetting.Create();
517 begin
518         FNameList := TStringList.Create;
519         FMailList := TStringList.Create;
520         FSelectTextList := TStringList.Create;
521     FBoardURLs := TStringList.Create;
522         FNameList.Duplicates := dupIgnore;
523         FMailList.Duplicates := dupIgnore;
524     FBoardURLs.Duplicates := dupIgnore;
525         FSelectTextList.Duplicates := dupIgnore;
526         ReadSettingFile();
527     ReadBoardURLsFile();
528 end;
529
530 //\83f\83X\83g\83\89\83N\83^
531 destructor TSetting.Destroy();
532 begin
533         inherited;
534         FSelectTextList.Free;
535     FBoardURLs.Free;
536         FMailList.Free;
537         FNameList.Free;
538 end;
539
540 //\8f\89\8aú\89»\83t\83@\83C\83\8b\96¼\8eæ\93¾\81i\83p\83X\81{\83t\83@\83C\83\8b\96¼\81j
541 function TSetting.GetFileName(): string;
542 begin
543         Result := ExtractFilePath(Application.ExeName) + INI_FILE_NAME;
544 end;
545
546 //\94Â\8dX\90V\97pURL\90Ý\92è\83t\83@\83C\83\8b\96¼\81i\83p\83X\81{\83t\83@\83C\83\8b\96¼\81j
547 function TSetting.GetBoardURLFileName(): string;
548 begin
549         Result := ExtractFilePath(Application.ExeName) + BOARD_URL_INI_FILE_NAME;
550 end;
551
552 //\90Ý\92è\83t\83@\83C\83\8b\93Ç\8d\9e
553 procedure TSetting.ReadSettingFile();
554 const
555         DEFAULT_BBS_WIDTH: array[0..0] of Integer = (140);
556         DEFAULT_CATEGORY_WIDTH: array[0..2] of Integer = (150, 80, 130);
557         DEFAULT_BOARD_WIDTH: array[0..6] of Integer = (350, 60, 60, 60, 60, 80, 130);
558 var
559         ini: TMemIniFile;
560         i: Integer;
561         wkList: TStringList;
562         wkStr: string;
563         Exists: Boolean;
564         s: string;
565 //      id: Integer;
566         CoolSet: TCoolSet;
567 begin
568         Exists := FileExists(GetFileName);
569         ini := TMemIniFile.Create(GetFileName);
570         try
571                 //\8eó\90M\83o\83b\83t\83@\83T\83C\83Y
572                 FRecvBufferSize := ini.ReadInteger('HTTP', 'RecvBufferSize', 4096);
573                 //HTTP1.1\8eg\97p
574                 FProtocol := ini.ReadBool('HTTP', 'Protocol', True);
575                 //\83v\83\8d\83L\83V\90Ú\91±HTTP1.1\8eg\97p
576                 FProxyProtocol := ini.ReadBool('HTTP', 'ProxyProtocol', False);
577
578                 FReadProxy := ini.ReadBool('ReadProxy', 'Proxy', false);
579                 FReadProxyAddress := ini.ReadString('ReadProxy', 'Address', '');
580                 FReadProxyPort := ini.ReadInteger('ReadProxy', 'Port', 0);
581                 FReadProxyUserID := ini.ReadString('ReadProxy', 'UserID', '');
582                 FReadProxyPassword := ini.ReadString('ReadProxy', 'Password', '');
583
584                 FWriteProxy := ini.ReadBool('WriteProxy', 'Proxy', false);
585                 FWriteProxyAddress := ini.ReadString('WriteProxy', 'Address', '');
586                 FWriteProxyPort := ini.ReadInteger('WriteProxy', 'Port', 0);
587                 FWriteProxyUserID := ini.ReadString('WriteProxy', 'UserID', '');
588                 FWriteProxyPassword := ini.ReadString('WriteProxy', 'Password', '');
589
590                 FBrowserFontName := ini.ReadString('Window', 'BrowserFontName', '');
591                 FBrowserFontSize := ini.ReadInteger('Window', 'BrowserFontSize', 0);
592                 FBrowserFontBold := ini.ReadInteger('Window', 'BrowserFontBold', 0);
593                 FBrowserFontItalic := ini.ReadInteger('Window', 'BrowserFontItalic', 0);
594                 FBrowserFontColor := ini.ReadInteger('Window', 'BrowserFontColor', -1);
595                 FBrowserBackColor := ini.ReadInteger('Window', 'BrowserBackColor', -1);
596
597                 FCabinetFontName := ini.ReadString('Window', 'CabinetFontName', DEFAULT_FONT_NAME);
598                 FCabinetFontSize := ini.ReadInteger('Window', 'CabinetFontSize', DEFAULT_FONT_SIZE);
599                 FCabinetFontBold := ini.ReadBool('Window', 'CabinetFontBold', False);
600                 FCabinetFontItalic := ini.ReadBool('Window', 'CabinetFontItalic', False);
601                 FCabinetFontColor := StringToColor(ini.ReadString('Window', 'CabinetFontColor', DEFAULT_FONT_COLOR));
602                 FCabinetBackColor := StringToColor(ini.ReadString('Window', 'CabinetBackColor', DEFAULT_WINDOW_COLOR));
603
604                 FListFontName := ini.ReadString('Window', 'ListFontName', DEFAULT_FONT_NAME);
605                 FListFontSize := ini.ReadInteger('Window', 'ListFontSize', DEFAULT_FONT_SIZE);
606                 FListFontBold := ini.ReadBool('Window', 'ListFontBold', False);
607                 FListFontItalic := ini.ReadBool('Window', 'ListFontItalic', False);
608                 FListFontColor := StringToColor(ini.ReadString('Window', 'ListFontColor', DEFAULT_FONT_COLOR));
609                 FListBackColor := StringToColor(ini.ReadString('Window', 'ListBackColor', DEFAULT_WINDOW_COLOR));
610
611                 FEditorFontName := ini.ReadString('Window', 'EditorFontName', DEFAULT_FONT_NAME);
612                 FEditorFontSize := ini.ReadInteger('Window', 'EditorFontSize', DEFAULT_FONT_SIZE);
613                 FEditorFontBold := ini.ReadBool('Window', 'EditorFontBold', False);
614                 FEditorFontItalic := ini.ReadBool('Window', 'EditorFontItalic', False);
615                 FEditorFontColor := StringToColor(ini.ReadString('Window', 'EditorFontColor', DEFAULT_FONT_COLOR));
616                 FEditorBackColor := StringToColor(ini.ReadString('Window', 'EditorBackColor', DEFAULT_WINDOW_COLOR));
617
618                 FBrowserTabFontName := ini.ReadString('Window', 'BrowserTabFontName', DEFAULT_TAB_FONT_NAME);
619                 FBrowserTabFontSize := ini.ReadInteger('Window', 'BrowserTabFontSize', DEFAULT_TAB_FONT_SIZE);
620                 FBrowserTabFontBold := ini.ReadBool('Window', 'BrowserTabFontBold', False);
621                 FBrowserTabFontItalic := ini.ReadBool('Window', 'BrowserTabFontItalic', False);
622
623                 FHintFontName := ini.ReadString('Window', 'HintFontName', Screen.HintFont.Name);
624                 FHintFontSize := ini.ReadInteger('Window', 'HintFontSize', Screen.HintFont.Size);
625                 //FHintFontBold := ini.ReadBool('Window', 'HintFontBold', False);
626                 //FHintFontItalic := ini.ReadBool('Window', 'HintFontItalic', False);
627                 FHintFontColor := StringToColor(ini.ReadString('Window', 'HintFontColor', DEFAULT_FONT_COLOR));
628                 FHintBackColor := StringToColor(ini.ReadString('Window', 'HintBackColor', 'clInfoBk'));
629
630                 FWindowTop := ini.ReadInteger('WindowSize', 'Top', -1);
631                 FWindowLeft := ini.ReadInteger('WindowSize', 'Left', -1);
632                 FWindowHeight := ini.ReadInteger('WindowSize', 'Height', -1);
633                 FWindowWidth := ini.ReadInteger('WindowSize', 'Width', -1);
634                 FWindowMax := ini.ReadBool('WindowSize', 'Max', false);
635
636                 if FWindowHeight <= 0 then      FWindowHeight := 400;
637                 if FWindowWidth <= 0 then FWindowWidth := 600;
638
639                 FListStyle := TViewStyle(ini.ReadInteger('ViewStyle', 'ListView', Ord(vsReport)));
640
641                 FEditWindowTop := ini.ReadInteger('EditorWindowSize', 'Top', -1);
642                 FEditWindowLeft := ini.ReadInteger('EditorWindowSize', 'Left', -1);
643                 FEditWindowHeight := ini.ReadInteger('EditorWindowSize', 'Height', -1);
644                 FEditWindowWidth := ini.ReadInteger('EditorWindowSize', 'Width', -1);
645                 FEditWindowMax := ini.ReadBool('EditorWindowSize', 'Max', False);
646
647     FOptionDialogTabIndex := ini.ReadInteger('OptionDialog', 'TabIndex', 0);
648
649                 //\83c\81[\83\8b\83o\81[
650                 FStdToolBarVisible := ini.ReadBool('ToolBar', 'StdVisible', True);
651                 FAddressBarVisible := ini.ReadBool('ToolBar', 'AddressVisible', True);
652                 FLinkBarVisible := ini.ReadBool('ToolBar', 'LinkVisible', True);
653                 FListToolBarVisible := ini.ReadBool('ToolBar', 'ListVisible', True);
654                 FListNameBarVisible := ini.ReadBool('ToolBar', 'ListNameVisible', True);
655                 FBrowserToolBarVisible := ini.ReadBool('ToolBar', 'BrowserVisible', True);
656                 FBrowserNameBarVisible := ini.ReadBool('ToolBar', 'BrowserNameVisible', True);
657                 //\83c\81[\83\8b\83o\81[Wrapable
658                 FListToolBarWrapable := ini.ReadBool('ToolBar', 'ListWrapable', False);
659                 FBrowserToolBarWrapable := ini.ReadBool('ToolBar', 'BrowserWrapable', False);
660
661                 FBrowserTabVisible := ini.ReadBool('Tab', 'BrowserTabVisible', True);
662                 FBrowserTabPosition := TGikoTabPosition(ini.ReadInteger('Tab', 'BrowserTabPosition', Ord(gtpTop)));
663                 FBrowserTabAppend := TGikoTabAppend(ini.ReadInteger('Tab', 'BrowserTabAppend', Ord(gtaFirst)));
664                 FBrowserTabStyle := TGikoTabStyle(ini.ReadInteger('Tab', 'BrowserTabStyle', Ord(gtsFlat)));
665
666                 FMessageBarVisible := ini.ReadBool('MessageBar', 'Visible', True);
667                 FMessegeBarHeight := ini.ReadInteger('MessageBar', 'Height', 30);
668
669                 FStatusBarVisible := ini.ReadBool('StatusBar', 'Visible', True);
670
671                 FCabinetVisible := ini.ReadBool('Cabinet', 'Visible', True);
672                 FCabinetWidth := ini.ReadInteger('Cabinet', 'Width', 200);
673     FCabinetIndex := ini.ReadInteger('Cabinet', 'Index', 0);
674
675                 FListOrientation := TGikoListOrientation(ini.ReadInteger('List', 'Orientation', Ord(gloHorizontal)));
676                 FListHeight := ini.ReadInteger('List', 'Height', 180);
677                 FListHeightState := TGikoListState(ini.ReadInteger('List', 'HeightState', Ord(glsNormal)));
678                 FListWidth := ini.ReadInteger('List', 'Width', 180);
679                 FListWidthState := TGikoListState(ini.ReadInteger('List', 'WidthState', Ord(glsNormal)));
680 //              FListHeightMax := ini.ReadBool('List', 'HeightMax', False);
681 //              FListWidthMax := ini.ReadBool('List', 'WidthMax', False);
682
683                 wkList := TStringList.Create;
684                 try
685                         ini.ReadSection('Name', wkList);
686                         for i := 0 to wkList.Count - 1 do begin
687                                 wkStr := ini.ReadString('Name', wkList[i], '');
688                                 if (wkStr <> '') and (FNameList.IndexOf(wkStr) = -1) then
689                                         FNameList.Add(wkStr);
690                         end;
691                         ini.ReadSection('Mail', wkList);
692                         for i := 0 to wkList.Count - 1 do begin
693                                 wkStr := ini.ReadString('Mail', wkList[i], '');
694                                 if (wkStr <> '') and (FMailList.IndexOf(wkStr) = -1) then
695                                         FMailList.Add(wkStr);
696                         end;
697                         ini.ReadSection('SelectText', wkList);
698                         for i := 0 to wkList.Count - 1 do begin
699                                 wkStr := ini.ReadString('SelectText', wkList[i], '');
700                                 if (wkStr <> '') and (FSelectTextList.IndexOf(wkStr) = -1) then
701                                         FSelectTextList.Add(wkStr);
702                         end;
703                 finally
704                         wkList.Free;
705                 end;
706
707                 //\83\8a\83X\83g\83J\83\89\83\80
708                 wkList := TStringList.Create;
709                 try
710                         ini.ReadSection('BBSColumnWidth', wkList);
711                         if Length(FBBSColumnWidth) <> wkList.Count then begin
712                                 ini.EraseSection('BBSColumnWidth');
713                         end;
714                         for i := 0 to Length(FBBSColumnWidth) - 1 do begin
715                                 BBSColumnWidth[i] := ini.ReadInteger('BBSColumnWidth', 'ID' + IntToStr(i), DEFAULT_BBS_WIDTH[i]);
716                         end;
717                         ini.ReadSection('CategoryColumnWidth', wkList);
718                         if Length(FCategoryColumnWidth) <> wkList.Count then begin
719                                 ini.EraseSection('CategoryColumnWidth');
720                         end;
721                         for i := 0 to Length(FCategoryColumnWidth) - 1 do begin
722                                 CategoryColumnWidth[i] := ini.ReadInteger('CategoryColumnWidth', 'ID' + IntToStr(i), DEFAULT_CATEGORY_WIDTH[i]);
723                         end;
724                         ini.ReadSection('BoardColumnWidth', wkList);
725                         if Length(FBoardColumnWidth) <> wkList.Count then begin
726                                 ini.EraseSection('BoardColumnWidth');
727                         end;
728                         for i := 0 to Length(FBoardColumnWidth) - 1 do begin
729                                 BoardColumnWidth[i] := ini.ReadInteger('BoardColumnWidth', 'ID' + IntToStr(i), DEFAULT_BOARD_WIDTH[i]);
730                         end;
731                 finally
732                         wkList.Free;
733                 end;
734
735
736                 //\83\8a\83X\83g\94Ô\8d\86
737                 FListViewNo := ini.ReadBool('Function', 'ListViewNo', True);
738                 //CSS
739                 FUseCSS := ini.ReadBool('CSS', 'UseCSS', True);
740                 //CSS\83t\83@\83C\83\8b\96¼
741                 FCSSFileName := ini.ReadString('CSS', 'FileName', 'default.css');
742
743                 //Mail\97\93\95\\8e¦
744                 FShowMail := ini.ReadBool('Thread', 'ShowMail', True);
745         //\8dÅ\90V100\83\8c\83X\95\\8e¦
746         FOnlyAHundredRes := ini.ReadBool('Thread', 'OnlyAHundredRes',false);
747                 //\94ñ\83A\83N\83e\83B\83u\8e\9e\83\8c\83X\83|\83b\83v\83A\83b\83v\95\\8e¦
748                 FUnActivePopup := ini.ReadBool('Thread', 'UnActivePopup', False);
749                 //\83\8c\83X\83|\83b\83v\83A\83b\83v\83w\83b\83_\81[\83{\81[\83\8b\83h
750                 FResPopupHeaderBold := ini.ReadBool('Thread', 'ResPopupHeaderBold', True);
751
752                 //\8dí\8f\9c\8am\94F
753                 FDeleteMsg := ini.ReadBool('Function', 'LogDeleteMessage', True);
754         //\8fI\97¹\8am\94F
755             FShowDialogForEnd := ini.ReadBool('Function','ShowDialogForEnd',false);
756
757                 //\83\8d\83O\83t\83H\83\8b\83_
758                 FLogFolder := ini.ReadString('Folder', 'LogFolder', ExtractFilePath(Application.ExeName) + 'Log');
759                 NewLogFolder := '';
760
761                 //\94ÂURL
762         //\95¡\90\94\93o\98^\82Å\82«\82é\82æ\82¤\82É\82µ\82ÄFBoardURLs\82É\82µ\82½\81@2003/10/05
763                 //FBoardURL2ch := ini.ReadString('BoardURL', '2ch', DEFAULT_2CH_BOARD_URL);
764
765                 //\94F\8fØ\97p\83\86\81[\83UID\81E\83p\83X\83\8f\81[\83h
766                 FUserID := ini.ReadString('Attestation', 'UserID', '');
767                 FPassword := Decrypt(ini.ReadString('Attestation', 'Password', ''));
768                 FAutoLogin := ini.ReadBool('Attestation', 'AutoLogin', False);
769
770                 //URL\83N\83\8a\83b\83N\8e\9e\8bN\93®\83A\83v\83\8a
771                 FURLApp := ini.ReadBool('URLApp', 'Select', False);
772                 FURLAppFile := ini.ReadString('URLApp', 'File', '');
773
774                 //mailto\83N\83\8a\83b\83N\8e\9e\93®\8dì
775                 FOpenMailer := ini.ReadBool('Mailto', 'Open', True);
776
777                 //\83|\83b\83v\83A\83b\83v\88Ê\92u
778                 FPopupPosition := TGikoPopupPosition(ini.ReadInteger('Browser', 'PopupPosition', Ord(gppLeftBottom)));
779
780                 //\83A\83h\83\8c\83X\83o\81[
781                 FURLDisplay := ini.ReadBool('AddressBar', 'URLDisplay', False);
782                 FAddressBarTabStop := ini.ReadBool('AddressBar', 'TabStop', True);
783                 FLinkAddAddressBar := ini.ReadBool('AddressBar', 'LinkAdd', False);
784                 FAddressHistoryCount := ini.ReadInteger('AddressBar', 'HistoryCount', 100);
785
786                 //\89æ\91\9c\83v\83\8c\83r\83\85\81[
787                 FPreviewVisible := ini.ReadBool('Browser', 'PreviewVisible', True);
788                 FPreviewSize := TGikoPreviewSize(ini.ReadInteger('Browser', 'PreviewSize', Ord(gpsMedium)));
789                 FPreviewWait := ini.ReadInteger('Browser', 'PreviewWait', 500);
790
791                 //\83X\83\8c\83b\83h\88ê\97\97\8dX\90V\83A\83C\83R\83\93
792                 FListIconVisible := ini.ReadBool('ThreadList', 'StateIconVisible', True);
793
794                 //\8f\91\82«\8d\9e\82Ý\8e\9e\83}\83V\83\93\8e\9e\8d\8f\8eg\97p\90Ý\92è
795                 FUseMachineTime := ini.ReadBool('PostTime', 'UseMachineTime', False);
796                 FTimeAdjustSec := ini.ReadInteger('PostTime', 'TimeAdjustSec', 0);
797                 FTimeAdjust := ini.ReadBool('PostTime', 'TimeAdjust', True);
798
799                 //\83T\83E\83\93\83h
800                 if Exists then begin
801                         for i := 0 to GetSoundCount - 1 do begin
802                                 SoundFileName[i] := ini.ReadString('Sound', SoundName[i], '');
803                                 if not FileExists(SoundFileName[i]) then
804                                         SoundFileName[i] := '';
805                         end;
806                 end else begin
807                         s := ExtractFileDir(Application.ExeName) + '\sound\';
808                         SoundFileName[0] := s + '\8eæ\93¾\90¬\8c÷.wav';
809                         SoundFileName[1] := s + '\8eæ\93¾\90¬\8c÷(\8d·\95ª).wav';
810                         SoundFileName[2] := s + '\96¢\8dX\90V.wav';
811                         SoundFileName[3] := '';
812                         SoundFileName[4] := s + '\83G\83\89\81[.wav';
813                 end;
814
815                 //\83N\81[\83\8b\83o\81[
816                 for i := 0 to MAIN_COOLBAND_COUNT - 1 do begin
817                         CoolSet.FCoolID := ini.ReadInteger('MainCoolBar', 'ID' + IntToStr(i), -1);
818                         CoolSet.FCoolWidth := ini.ReadInteger('MainCoolBar', 'Width' + IntToStr(i), -1);
819                         CoolSet.FCoolBreak := ini.ReadBool('MainCoolBar', 'Break' + IntToStr(i), False);
820                         MainCoolSet[i] := CoolSet;
821                 end;
822     FSelectComboBoxWidth := ini.ReadInteger( 'ListCoolBar', 'SelectWidth', 127 );
823                 for i := 0 to LIST_COOLBAND_COUNT - 1 do begin
824                         CoolSet.FCoolID := ini.ReadInteger('ListCoolBar', 'ID' + IntToStr(i), -1);
825                         CoolSet.FCoolWidth := ini.ReadInteger('ListCoolBar', 'Width' + IntToStr(i), -1);
826                         CoolSet.FCoolBreak := ini.ReadBool('ListCoolBar', 'Break' + IntToStr(i), False);
827                         ListCoolSet[i] := CoolSet;
828                 end;
829                 for i := 0 to BROWSER_COOLBAND_COUNT - 1 do begin
830                         CoolSet.FCoolID := ini.ReadInteger('BrowserCoolBar', 'ID' + IntToStr(i), -1);
831                         CoolSet.FCoolWidth := ini.ReadInteger('BrowserCoolBar', 'Width' + IntToStr(i), -1);
832                         CoolSet.FCoolBreak := ini.ReadBool('BrowserCoolBar', 'Break' + IntToStr(i), False);
833                         BrowserCoolSet[i] := CoolSet;
834                 end;
835
836     //\82 \82Ú\81`\82ñ
837     FAbonDeleterlo := ini.ReadBool('Abon','Deleterlo',false);
838     FAbonReplaceul := ini.ReadBool('Abon','Replaceul',false);
839     FPopUpAbon     := ini.ReadBool('Abon','Popup',false);
840     FShowNGLinesNum := ini.ReadBool('Abon','ShowNGLines',false);
841     FAddResAnchor := ini.ReadBool('Abon','AddResAnchor',false);
842
843
844         finally
845                 ini.Free;
846         end;
847 end;
848 //\94Â\8dX\90V\97pURL\93Ç\82Ý\8d\9e\82Ý
849 procedure TSetting.ReadBoardURLsFile();
850 var
851         ini: TMemIniFile;
852     urlNum: Integer;
853     i : Integer;
854 begin
855     if not FileExists(GetBoardURLFileName()) then
856             MakeURLIniFile();
857         ini := TMemIniFile.Create(GetBoardURLFileName());
858     try
859         urlNum := ini.ReadInteger('URL','count',0);
860         BoardURLSelected := ini.ReadInteger('URL','selected',0);
861         for i := 0 to urlNum - 1 do begin
862                 FBoardURLs.Append(ini.ReadString('URL',IntToStr(i+1),''));
863         end;
864     finally
865         ini.Free;
866     end;
867
868 end;
869 //\90Ý\92è\83t\83@\83C\83\8b\95Û\91¶(system)
870 procedure TSetting.WriteSystemSettingFile();
871 var
872         ini: TMemIniFile;
873 begin
874         ini := TMemIniFile.Create(GetFileName());
875         try
876                 //\8eó\90M\83o\83b\83t\83@\83T\83C\83Y
877                 ini.WriteInteger('HTTP', 'RecvBufferSize', FRecvBufferSize);
878                 //HTTP1.1\8eg\97p
879                 ini.WriteBool('HTTP', 'Protocol', FProtocol);
880                 //\83v\83\8d\83L\83V\90Ú\91±HTTP1.1\8eg\97p
881                 ini.WriteBool('HTTP', 'ProxyProtocol', FProxyProtocol);
882
883                 ini.WriteBool('ReadProxy', 'Proxy', FReadProxy);
884                 ini.WriteString('ReadProxy', 'Address', FReadProxyAddress);
885                 ini.WriteInteger('ReadProxy', 'Port', FReadProxyPort);
886                 ini.WriteString('ReadProxy', 'UserID', FReadProxyUserID);
887                 ini.WriteString('ReadProxy', 'Password', FReadProxyPassword);
888
889                 ini.WriteBool('WriteProxy', 'Proxy', FWriteProxy);
890                 ini.WriteString('WriteProxy', 'Address', FWriteProxyAddress);
891                 ini.WriteInteger('WriteProxy', 'Port', FWriteProxyPort);
892                 ini.WriteString('WriteProxy', 'UserID', FWriteProxyUserID);
893                 ini.WriteString('WriteProxy', 'Password', FWriteProxyPassword);
894
895                 ini.WriteString('Window', 'BrowserFontName', FBrowserFontName);
896                 ini.WriteInteger('Window', 'BrowserFontSize', FBrowserFontSize);
897                 ini.WriteInteger('Window', 'BrowserFontSize', FBrowserFontSize);
898                 ini.WriteInteger('Window', 'BrowserFontBold', FBrowserFontBold);
899                 ini.WriteInteger('Window', 'BrowserFontItalic', FBrowserFontItalic);
900                 ini.WriteInteger('Window', 'BrowserFontColor', FBrowserFontColor);
901                 ini.WriteInteger('Window', 'BrowserBackColor', FBrowserBackColor);
902
903                 ini.WriteString('Window', 'CabinetFontName', FCabinetFontName);
904                 ini.WriteInteger('Window', 'CabinetFontSize', FCabinetFontSize);
905                 ini.WriteString('Window', 'CabinetFontColor', ColorToString(FCabinetFontColor));
906                 ini.WriteString('Window', 'CabinetBackColor', ColorToString(FCabinetBackColor));
907
908                 ini.WriteString('Window', 'ListFontName', FListFontName);
909                 ini.WriteInteger('Window', 'ListFontSize', FListFontSize);
910                 ini.WriteString('Window', 'ListFontColor', ColorToString(FListFontColor));
911                 ini.WriteString('Window', 'ListBackColor', ColorToString(FListBackColor));
912
913                 ini.WriteString('Window', 'EditorFontName', FEditorFontName);
914                 ini.WriteInteger('Window', 'EditorFontSize', FEditorFontSize);
915                 ini.WriteString('Window', 'EditorFontColor', ColorToString(FEditorFontColor));
916                 ini.WriteString('Window', 'EditorBackColor', ColorToString(FEditorBackColor));
917
918                 ini.WriteString('Window', 'BrowserTabFontName', FBrowserTabFontName);
919                 ini.WriteInteger('Window', 'BrowserTabFontSize', FBrowserTabFontSize);
920                 ini.WriteBool('Window', 'BrowserTabFontBold', FBrowserTabFontBold);
921                 ini.WriteBool('Window', 'BrowserTabFontItalic', FBrowserTabFontItalic);
922
923                 ini.WriteString('Window', 'HintFontName', FHintFontName);
924                 ini.WriteInteger('Window', 'HintFontSize', FHintFontSize);
925                 ini.WriteString('Window', 'HintFontColor', ColorToString(FHintFontColor));
926                 ini.WriteString('Window', 'HintBackColor', ColorToString(FHintBackColor));
927
928                 ini.UpdateFile;
929         finally
930                 ini.Free;
931         end;
932 end;
933
934 //\90Ý\92è\83t\83@\83C\83\8b\95Û\91¶(window)
935 procedure TSetting.WriteWindowSettingFile();
936 var
937         i: Integer;
938         ini: TMemIniFile;
939         CoolSet: TCoolSet;
940 begin
941         ini := TMemIniFile.Create(GetFileName());
942         try
943                 ini.WriteInteger('WindowSize', 'Top', WindowTop);
944                 ini.WriteInteger('WindowSize', 'Left', WindowLeft);
945                 ini.WriteInteger('WindowSize', 'Height', WindowHeight);
946                 ini.WriteInteger('WindowSize', 'Width', WindowWidth);
947                 ini.WriteBool('WindowSize', 'Max', WindowMax);
948
949                 ini.WriteInteger('ViewStyle', 'ListView', Ord(ListStyle));
950
951                 ini.WriteInteger('EditorWindowSize', 'Top', EditWindowTop);
952                 ini.WriteInteger('EditorWindowSize', 'Left', EditWindowLeft);
953                 ini.WriteInteger('EditorWindowSize', 'Height', EditWindowHeight);
954                 ini.WriteInteger('EditorWindowSize', 'Width', EditWindowWidth);
955                 ini.WriteBool('EditorWindowSize', 'Max', EditWindowMax);
956
957     ini.WriteInteger('OptionDialog', 'TabIndex', FOptionDialogTabIndex);
958
959                 //\83c\81[\83\8b\83o\81[
960                 ini.WriteBool('ToolBar', 'StdVisible', FStdToolBarVisible);
961                 ini.WriteBool('ToolBar', 'AddressVisible', FAddressBarVisible);
962                 ini.WriteBool('ToolBar', 'LinkVisible', FLinkBarVisible);
963                 ini.WriteBool('ToolBar', 'ListVisible', FListToolBarVisible);
964                 ini.WriteBool('ToolBar', 'ListNameVisible', FListNameBarVisible);
965                 ini.WriteBool('ToolBar', 'BrowserVisible', FBrowserToolBarVisible);
966                 ini.WriteBool('ToolBar', 'BrowserNameVisible', FBrowserNameBarVisible);
967                 //\83c\81[\83\8b\83o\81[Wrapable
968                 ini.WriteBool('ToolBar', 'ListWrapable', FListToolBarWrapable);
969                 ini.WriteBool('ToolBar', 'BrowserWrapable', FBrowserToolBarWrapable);
970
971                 //\83^\83u
972                 ini.WriteBool('Tab', 'BrowserTabVisible', FBrowserTabVisible);
973                 ini.WriteInteger('Tab', 'BrowserTabPosition', Ord(FBrowserTabPosition));
974                 ini.WriteInteger('Tab', 'BrowserTabAppend', Ord(FBrowserTabAppend));
975                 ini.WriteInteger('Tab', 'BrowserTabStyle', Ord(FBrowserTabStyle));
976
977                 //\83\81\83b\83Z\81[\83W\83o\81[
978                 ini.WriteBool('MessageBar', 'Visible', FMessageBarVisible);
979                 ini.WriteInteger('MessageBar', 'Height', FMessegeBarHeight);
980
981                 //\83X\83e\81[\83^\83X\83o\81[
982                 ini.WriteBool('StatusBar', 'Visible', FStatusBarVisible);
983
984                 //\83L\83\83\83r\83l\83b\83g
985                 ini.WriteBool('Cabinet', 'Visible', FCabinetVisible);
986                 ini.WriteInteger('Cabinet', 'Width', FCabinetWidth);
987     ini.WriteInteger('Cabinet', 'Index', FCabinetIndex);
988
989                 //\83\8a\83X\83g\82Ì\83T\83C\83Y\82Æ\90\82\92¼\90\85\95½
990                 ini.WriteInteger('List', 'Orientation', Ord(FListOrientation));
991                 ini.WriteInteger('List', 'Height', FListHeight);
992                 ini.WriteInteger('List', 'HeightState', Ord(FListHeightState));
993                 ini.WriteInteger('List', 'Width', FListWidth);
994                 ini.WriteInteger('List', 'WidthState', Ord(FListWidthState));
995 //              ini.WriteBool('List', 'HeightMax', FListHeightMax);
996 //              ini.WriteBool('List', 'WidthMax', FListWidthMax);
997
998
999 //              ini.WriteInteger('Window', 'BrowserFontSize', BrowserFontSize);
1000
1001                 //\83\8a\83X\83g\94Ô\8d\86\95\\8e¦
1002                 ini.WriteBool('Function', 'ListViewNo', FListViewNo);
1003                 //CSS\8eg\97p
1004                 ini.WriteBool('CSS', 'UseCSS', FUseCSS);
1005                 //CSS\83t\83@\83C\83\8b\96¼
1006                 ini.WriteString('CSS', 'FileName', FCSSFileName);
1007                 //Mail\97\93\95\\8e¦
1008                 ini.WriteBool('Thread', 'ShowMail', FShowMail);
1009         //\8dÅ\90V100\83\8c\83X\95\\8e¦
1010         ini.WriteBool('Thread', 'OnlyAHundredRes', FOnlyAHundredRes);
1011                 //\83\8d\83O\8dí\8f\9c\8am\94F
1012                 ini.WriteBool('Function', 'LogDeleteMessage', FDeleteMsg);
1013         //\8fI\97¹\8am\94F
1014             ini.WriteBool('Function','ShowDialogForEnd',FShowDialogForEnd);
1015                 //\94ñ\83A\83N\83e\83B\83u\8e\9e\83|\83b\83v\83A\83b\83v\95\\8e¦
1016                 ini.WriteBool('Thread', 'UnActivePopup', FUnActivePopup);
1017                 //\83\8c\83X\83|\83b\83v\83A\83b\83v\83w\83b\83_\81[\83{\81[\83\8b\83h
1018                 ini.WriteBool('Thread', 'ResPopupHeaderBold', FResPopupHeaderBold);
1019
1020                 //ini.WriteString('BoardURL', '2ch', FBoardURL2ch);
1021
1022                 //\94F\8fØ\97p\83\86\81[\83UID\81E\83p\83X\83\8f\81[\83h
1023                 ini.WriteString('Attestation', 'UserID', FUserID);
1024                 ini.WriteString('Attestation', 'Password', Encrypt(FPassword));
1025                 ini.WriteBool('Attestation', 'AutoLogin', FAutoLogin);
1026
1027                 //URL\83N\83\8a\83b\83N\8e\9e\8bN\93®\83A\83v\83\8a
1028                 ini.WriteBool('URLApp', 'Select', FURLApp);
1029                 ini.WriteString('URLApp', 'File', FURLAppFile);
1030
1031                 //mailto\83N\83\8a\83b\83N\8e\9e\93®\8dì
1032                 ini.WriteBool('Mailto', 'Open', FOpenMailer);
1033
1034                 //\83|\83b\83v\83A\83b\83v\88Ê\92u
1035                 ini.WriteInteger('Browser', 'PopupPosition', Ord(FPopupPosition));
1036
1037                 //\83A\83h\83\8c\83X\83o\81[
1038                 ini.WriteBool('AddressBar', 'URLDisplay', FURLDisplay);
1039                 ini.WriteBool('AddressBar', 'TabStop', FAddressBarTabStop);
1040                 ini.WriteBool('AddressBar', 'LinkAdd', FLinkAddAddressBar);
1041                 ini.WriteInteger('AddressBar', 'HistoryCount', FAddressHistoryCount);
1042
1043                 //\89æ\91\9c\83v\83\8c\83r\83\85\81[
1044                 ini.WriteBool('Browser', 'PreviewVisible', FPreviewVisible);
1045                 ini.WriteInteger('Browser', 'PreviewSize', Ord(FPreviewSize));
1046                 ini.WriteInteger('Browser', 'PreviewWait', FPreviewWait);
1047
1048                 //\83X\83\8c\83b\83h\88ê\97\97\8dX\90V\83A\83C\83R\83\93
1049                 ini.WriteBool('ThreadList', 'StateIconVisible', FListIconVisible);
1050
1051                 //\8f\91\82«\8d\9e\82Ý\8e\9e\83}\83V\83\93\8e\9e\8d\8f\8eg\97p\90Ý\92è
1052                 ini.WriteBool('PostTime', 'UseMachineTime', FUseMachineTime);
1053                 ini.WriteInteger('PostTime', 'TimeAdjustSec', FTimeAdjustSec);
1054                 ini.WriteBool('PostTime', 'TimeAdjust', FTimeAdjust);
1055
1056                 //\83\8a\83X\83g\83J\83\89\83\80
1057                 for i := 0 to Length(FBBSColumnWidth) - 1 do begin
1058                         ini.WriteInteger('BBSColumnWidth', 'ID' + IntToStr(i), FBBSColumnWidth[i]);
1059                 end;
1060                 for i := 0 to Length(FCategoryColumnWidth) - 1 do begin
1061                         ini.WriteInteger('CategoryColumnWidth', 'ID' + IntToStr(i), FCategoryColumnWidth[i]);
1062                 end;
1063                 for i := 0 to Length(FBoardColumnWidth) - 1 do begin
1064                         ini.WriteInteger('BoardColumnWidth', 'ID' + IntToStr(i), FBoardColumnWidth[i]);
1065                 end;
1066
1067                 //\83T\83E\83\93\83h
1068                 for i := 0 to GetSoundCount - 1 do begin
1069                         if not FileExists(SoundFileName[i]) then
1070                                 SoundFileName[i] := '';
1071                         ini.WriteString('Sound', SoundName[i], SoundFileName[i]);
1072                 end;
1073
1074                 //CoolBar
1075                 ini.EraseSection('MainCoolBar');
1076                 for i := 0 to MAIN_COOLBAND_COUNT - 1 do begin
1077                         CoolSet := MainCoolSet[i];
1078                         ini.WriteInteger('MainCoolBar', 'ID' + IntToStr(i), CoolSet.FCoolID);
1079                         ini.WriteInteger('MainCoolBar', 'Width' + IntToStr(i), CoolSet.FCoolWidth);
1080                         ini.WriteBool('MainCoolBar', 'Break' + IntToStr(i), CoolSet.FCoolBreak);
1081                 end;
1082                 ini.EraseSection('ListCoolBar');
1083     ini.WriteInteger( 'ListCoolBar', 'SelectWidth', FSelectComboBoxWidth );
1084                 for i := 0 to LIST_COOLBAND_COUNT - 1 do begin
1085                         CoolSet := ListCoolSet[i];
1086                         ini.WriteInteger('ListCoolBar', 'ID' + IntToStr(i), CoolSet.FCoolID);
1087                         ini.WriteInteger('ListCoolBar', 'Width' + IntToStr(i), CoolSet.FCoolWidth);
1088                         ini.WriteBool('ListCoolBar', 'Break' + IntToStr(i), CoolSet.FCoolBreak);
1089                 end;
1090                 ini.EraseSection('BrowserCoolBar');
1091                 for i := 0 to BROWSER_COOLBAND_COUNT - 1 do begin
1092                         CoolSet := BrowserCoolSet[i];
1093                         ini.WriteInteger('BrowserCoolBar', 'ID' + IntToStr(i), CoolSet.FCoolID);
1094                         ini.WriteInteger('BrowserCoolBar', 'Width' + IntToStr(i), CoolSet.FCoolWidth);
1095                         ini.WriteBool('BrowserCoolBar', 'Break' + IntToStr(i), CoolSet.FCoolBreak);
1096                 end;
1097
1098                 //\82 \82Ú\81`\82ñ
1099                 ini.WriteBool('Abon','Deleterlo',FAbonDeleterlo);
1100                 ini.WriteBool('Abon','Replaceul',FAbonReplaceul);
1101         ini.WriteBool('Abon','Popup',FPopUpAbon);
1102                 ini.WriteBool('Abon','ShowNGLines',FShowNGLinesNum);
1103                 ini.WriteBool('Abon','AddResAnchor',FAddResAnchor);
1104
1105                 ini.UpdateFile;
1106         finally
1107                 ini.Free;
1108         end;
1109 end;
1110
1111 //\90Ý\92è\83t\83@\83C\83\8b\95Û\91¶(name & mail)
1112 procedure TSetting.WriteNameMailSettingFile();
1113 var
1114         i: Integer;
1115         ini: TMemIniFile;
1116 begin
1117         ini := TMemIniFile.Create(GetFileName());
1118         try
1119                 ini.EraseSection('Name');
1120                 ini.EraseSection('Mail');
1121                 ini.EraseSection('SelectText');
1122                 for i := 0 to FNameList.Count - 1 do begin
1123                         ini.WriteString('Name', Format('%.2d', [i + 1]), FNameList[i]);
1124                         if i >= 39 then
1125                                 Break;
1126                 end;
1127                 for i := 0 to FMailList.Count - 1 do begin
1128                         ini.WriteString('Mail', Format('%.2d', [i + 1]), FMailList[i]);
1129                         if i >= 39 then
1130                                 Break;
1131                 end;
1132                 for i := 0 to FSelectTextList.Count - 1 do begin
1133                         ini.WriteString('SelectText', Format('%.2d', [i + 1]), FSelectTextList[i]);
1134                         if i >= 39 then
1135                                 Break;
1136                 end;
1137                 ini.UpdateFile;
1138         finally
1139                 ini.Free;
1140         end;
1141 end;
1142
1143 procedure TSetting.WriteFolderSettingFile();
1144 var
1145         ini: TMemIniFile;
1146 begin
1147         ini := TMemIniFile.Create(GetFileName());
1148         try
1149                 if ExtractFilePath(Application.ExeName) + 'Log' = NewLogFolder then
1150                         ini.DeleteKey('Folder', 'LogFolder')
1151                 else
1152                         ini.WriteString('Folder', 'LogFolder', NewLogFolder);
1153                 ini.UpdateFile;
1154         finally
1155                 ini.Free;
1156         end;
1157 end;
1158 //\94Â\8dX\90V\97pBoardURL\82ð\95Û\91
1159 procedure TSetting.WriteBoardURLSettingFile();
1160 var
1161         ini: TMemIniFile;
1162     i : Integer;
1163     oldcount : Integer;
1164 begin
1165         ini := TMemIniFile.Create(GetBoardURLFileName());
1166         try
1167         oldcount := ini.ReadInteger('URL','count',FBoardURLs.Count);
1168         ini.WriteInteger('URL','count',FBoardURLs.Count);
1169         ini.WriteInteger('URL','selected',BoardURLSelected);
1170         for i := 0 to FBoardURLs.Count -1 do begin
1171             ini.WriteString('URL',IntToStr(i+1),FBoardURLs.Strings[i]);
1172         end;
1173         if oldcount > FBoardURLs.Count then begin
1174                 for i := FBoardURLs.Count to oldcount do begin
1175                 ini.DeleteKey('URL',IntToStr(i+1));
1176             end;
1177         end;
1178                 ini.UpdateFile;
1179         finally
1180                 ini.Free;
1181         end;
1182 end;
1183
1184 //\83\8a\83X\83g\83J\83\89\83\80\83w\83b\83_\81[
1185 function TSetting.GetBBSColumnWidth(index: Integer): Integer;
1186 begin
1187         Result := IfThen(index in [0..Length(FBBSColumnWidth) - 1], FBBSColumnWidth[index], 0);
1188 end;
1189
1190 function TSetting.GetCategoryColumnWidth(index: Integer): Integer;
1191 begin
1192         Result := IfThen(index in [0..Length(FCategoryColumnWidth) - 1], FCategoryColumnWidth[index], 0);
1193 end;
1194
1195 function TSetting.GetBoardColumnWidth(index: Integer): Integer;
1196 begin
1197         Result := IfThen(index in [0..Length(FBoardColumnWidth) - 1], FBoardColumnWidth[index], 0);
1198 end;
1199
1200 procedure TSetting.SetBBSColumnWidth(index: Integer; value: Integer);
1201 begin
1202         if index in [0..Length(FBBSColumnWidth) - 1] then
1203                 FBBSColumnWidth[index] := value;
1204 end;
1205
1206 procedure TSetting.SetCategoryColumnWidth(index: Integer; value: Integer);
1207 begin
1208         if index in [0..Length(FCategoryColumnWidth) - 1] then
1209                 FCategoryColumnWidth[index] := value;
1210 end;
1211
1212 procedure TSetting.SetBoardColumnWidth(index: Integer; value: Integer);
1213 begin
1214         if index in [0..Length(FBoardColumnWidth) - 1] then
1215                 FBoardColumnWidth[index] := value;
1216 end;
1217
1218 function TSetting.GetSoundCount: Integer;
1219 begin
1220         Result := Length(SOUND_NAME);
1221 end;
1222
1223 function TSetting.GetSoundName(Index: Integer): string;
1224 begin
1225         if (Index < GetSoundCount) and (Index >= 0) then
1226                 Result := SOUND_NAME[Index].Name
1227         else
1228                 Result := '';
1229 end;
1230
1231 function TSetting.GetSoundViewName(Index: Integer): string;
1232 begin
1233         if (Index < GetSoundCount) and (Index >= 0) then
1234                 Result := SOUND_NAME[Index].ViewName
1235         else
1236                 Result := '';
1237 end;
1238
1239 function TSetting.GetSoundFileName(Index: Integer): string;
1240 begin
1241         if (Index < GetSoundCount) and (Index >= 0) then
1242                 Result := SOUND_NAME[Index].FileName
1243         else
1244                 Result := '';
1245 end;
1246
1247 procedure TSetting.SetSoundFileName(Index: Integer; value: string);
1248 begin
1249         if (Index < GetSoundCount) and (Index >= 0) then
1250                 SOUND_NAME[Index].FileName := value;
1251 end;
1252
1253 function TSetting.FindSoundFileName(Name: string): string;
1254 var
1255         i: Integer;
1256 begin
1257         for i := 0 to GetSoundCount - 1 do begin
1258                 if SoundName[i] = Name then begin
1259                         Result := SoundFileName[i];
1260                         Exit;
1261                 end;
1262         end;
1263         Result := '';
1264 end;
1265
1266 function TSetting.Encrypt(s: string): string;
1267 var
1268         cryptObj: THogeCryptAuto;
1269         inputStream, outputStream: TStringStream;
1270 begin
1271         inputStream := TStringStream.Create(s);
1272         outputStream := TStringStream.Create('');
1273         cryptObj := THogeCryptAuto.Create;
1274         try
1275                 // \88Ã\8d\86\89»
1276                 cryptObj.Encrypt(inputStream, GIKO_ENCRYPT_TEXT, outputStream);
1277
1278                 // \83o\83C\83i\83\8a\82È\82Ì\82Å\95K\97v\82É\89\9e\82\82Ä\83e\83L\83X\83g\82É\95Ï\8a·
1279                 Result := HogeBase64Encode(outputStream.DataString);
1280         finally
1281                 cryptObj.Free;
1282                 outputStream.Free;
1283                 inputStream.Free;
1284         end;
1285 end;
1286
1287 function TSetting.Decrypt(s: string): string;
1288 var
1289         cryptObj: THogeCryptAuto;
1290         inputStream, outputStream: TStringStream;
1291 begin
1292         try
1293                 inputStream := TStringStream.Create(HogeBase64Decode(s));
1294         except
1295                 Result := '';
1296                 Exit;
1297         end;
1298         outputStream := TStringStream.Create('');
1299         cryptObj := THogeCryptAuto.Create;
1300         try
1301                 // \95\9c\8d\86
1302                 cryptObj.Decrypt(inputStream, GIKO_ENCRYPT_TEXT, outputStream);
1303                 Result := outputStream.DataString;
1304         finally
1305                 cryptObj.Free;
1306                 outputStream.Free;
1307                 inputStream.Free;
1308         end;
1309 end;
1310
1311 function TSetting.GetMainCoolSet(Index: Integer): TCoolSet;
1312 begin
1313         if Index in [0..MAIN_COOLBAND_COUNT - 1] then
1314                 Result := FMainCoolBar[Index]
1315         else begin
1316                 Result.FCoolID := -1;
1317                 Result.FCoolWidth := -1;
1318                 Result.FCoolBreak := False;
1319         end;
1320 end;
1321
1322 function TSetting.GetBoardCoolSet(Index: Integer): TCoolSet;
1323 begin
1324         if Index in [0..LIST_COOLBAND_COUNT - 1] then
1325                 Result := FListCoolBar[Index]
1326         else begin
1327                 Result.FCoolID := -1;
1328                 Result.FCoolWidth := -1;
1329                 Result.FCoolBreak := False;
1330         end;
1331 end;
1332
1333 function TSetting.GetBrowserCoolSet(Index: Integer): TCoolSet;
1334 begin
1335         if Index in [0..BROWSER_COOLBAND_COUNT - 1] then
1336                 Result := FBrowserCoolBar[Index]
1337         else begin
1338                 Result.FCoolID := -1;
1339                 Result.FCoolWidth := -1;
1340                 Result.FCoolBreak := False;
1341         end;
1342 end;
1343
1344 procedure TSetting.SetMainCoolSet(Index: Integer; CoolSet: TCoolSet);
1345 begin
1346         if Index in [0..MAIN_COOLBAND_COUNT - 1] then
1347                 FMainCoolBar[Index] := CoolSet;
1348 end;
1349
1350 procedure TSetting.SetBoardCoolSet(Index: Integer; CoolSet: TCoolSet);
1351 begin
1352         if Index in [0..LIST_COOLBAND_COUNT - 1] then
1353                 FListCoolBar[Index] := CoolSet;
1354 end;
1355
1356 procedure TSetting.SetBrowserCoolSet(Index: Integer; CoolSet: TCoolSet);
1357 begin
1358         if Index in [0..BROWSER_COOLBAND_COUNT - 1] then
1359                 FBrowserCoolBar[Index] := CoolSet;
1360 end;
1361
1362 //url.ini\82ª\82È\82¢\82Æ\82«\82É\90\90¬\82·\82é
1363 procedure TSetting.MakeURLIniFile();
1364 var
1365         ini: TMemIniFile;
1366 begin
1367         ini := TMemIniFile.Create(GetBoardURLFileName());
1368         try
1369         ini.WriteInteger('URL','count',2);
1370         ini.WriteInteger('URL','selected',2);
1371         ini.WriteString('URL','1',DEFAULT_2CH_BOARD_URL1);
1372         ini.WriteString('URL','2',DEFAULT_2CH_BOARD_URL2);
1373                 ini.UpdateFile;
1374         finally
1375                 ini.Free;
1376         end;
1377 end;
1378
1379 end.
1380