OSDN Git Service

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