1 // OpenTween - Client of Twitter
2 // Copyright (c) 2007-2011 kiri_feather (@kiri_feather) <kiri.feather@gmail.com>
3 // (c) 2008-2011 Moz (@syo68k)
4 // (c) 2008-2011 takeshik (@takeshik) <http://www.takeshik.org/>
5 // (c) 2010-2011 anis774 (@anis774) <http://d.hatena.ne.jp/anis774/>
6 // (c) 2010-2011 fantasticswallow (@f_swallow) <http://twitter.com/f_swallow>
7 // (c) 2011 kim_upsilon (@kim_upsilon) <https://upsilo.net/~upsilon/>
8 // All rights reserved.
10 // This file is part of OpenTween.
12 // This program is free software; you can redistribute it and/or modify it
13 // under the terms of the GNU General Public License as published by the Free
14 // Software Foundation; either version 3 of the License, or (at your option)
17 // This program is distributed in the hope that it will be useful, but
18 // WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19 // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 // You should have received a copy of the GNU General Public License along
23 // with this program. If not, see <http://www.gnu.org/licenses/>, or write to
24 // the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
25 // Boston, MA 02110-1301, USA.
30 using System.Collections.Generic;
34 using System.Xml.Serialization;
35 using OpenTween.Connection;
39 public class SettingLocal : SettingBase<SettingLocal>
42 public static SettingLocal Load(string settingsPath)
43 => LoadSettings(settingsPath);
45 public void Save(string settingsPath)
46 => SaveSettings(this, settingsPath);
52 public SizeF ScaleDimension = SizeF.Empty;
54 public Point FormLocation = new(0, 0);
55 public int SplitterDistance = 200;
56 public Size FormSize = new(600, 500);
61 public string StatusText = "";
63 public bool UseRecommendStatus = false;
66 public int[] ColumnsWidth { get; } = { 48, 80, 290, 120, 50, 16, 32, 50 };
70 get => this.ColumnsWidth[0];
71 set => this.ColumnsWidth[0] = value;
76 get => this.ColumnsWidth[1];
77 set => this.ColumnsWidth[1] = value;
82 get => this.ColumnsWidth[2];
83 set => this.ColumnsWidth[2] = value;
88 get => this.ColumnsWidth[3];
89 set => this.ColumnsWidth[3] = value;
94 get => this.ColumnsWidth[4];
95 set => this.ColumnsWidth[4] = value;
100 get => this.ColumnsWidth[5];
101 set => this.ColumnsWidth[5] = value;
106 get => this.ColumnsWidth[6];
107 set => this.ColumnsWidth[6] = value;
112 get => this.ColumnsWidth[7];
113 set => this.ColumnsWidth[7] = value;
117 public int[] ColumnsOrder { get; } = { 2, 3, 4, 5, 6, 1, 0, 7 };
119 public int DisplayIndex1
121 get => this.ColumnsOrder[0];
122 set => this.ColumnsOrder[0] = value;
125 public int DisplayIndex2
127 get => this.ColumnsOrder[1];
128 set => this.ColumnsOrder[1] = value;
131 public int DisplayIndex3
133 get => this.ColumnsOrder[2];
134 set => this.ColumnsOrder[2] = value;
137 public int DisplayIndex4
139 get => this.ColumnsOrder[3];
140 set => this.ColumnsOrder[3] = value;
143 public int DisplayIndex5
145 get => this.ColumnsOrder[4];
146 set => this.ColumnsOrder[4] = value;
149 public int DisplayIndex6
151 get => this.ColumnsOrder[5];
152 set => this.ColumnsOrder[5] = value;
155 public int DisplayIndex7
157 get => this.ColumnsOrder[6];
158 set => this.ColumnsOrder[6] = value;
161 public int DisplayIndex8
163 get => this.ColumnsOrder[7];
164 set => this.ColumnsOrder[7] = value;
167 public string BrowserPath = "";
168 public ProxyType ProxyType = ProxyType.IE;
169 public string ProxyAddress = "127.0.0.1";
170 public int ProxyPort = 80;
171 public string ProxyUser = "";
172 public bool StatusMultiline = false;
173 public int StatusTextHeight = 38;
174 public int PreviewDistance = -1;
176 public string? FontUnreadStr { get; set; }
178 public string? ColorUnreadStr { get; set; }
180 public string? FontReadStr { get; set; }
182 public string? ColorReadStr { get; set; }
184 public string? ColorFavStr { get; set; }
186 public string? ColorOWLStr { get; set; }
188 public string? ColorRetweetStr { get; set; }
190 public string? FontDetailStr { get; set; }
192 public string? ColorSelfStr { get; set; }
194 public string? ColorAtSelfStr { get; set; }
196 public string? ColorTargetStr { get; set; }
198 public string? ColorAtTargetStr { get; set; }
200 public string? ColorAtFromTargetStr { get; set; }
202 public string? ColorAtToStr { get; set; }
204 public string? ColorInputBackcolorStr { get; set; }
206 public string? ColorInputFontStr { get; set; }
208 public string? FontInputFontStr { get; set; }
210 public string? ColorListBackcolorStr { get; set; }
212 public string? ColorDetailBackcolorStr { get; set; }
214 public string? ColorDetailStr { get; set; }
216 public string? ColorDetailLinkStr { get; set; }
219 /// [隠し設定] UI フォントを指定します
222 /// フォントによっては一部レイアウトが崩れるためこっそり追加
224 public string? FontUIGlobalStr { get; set; }
227 public string ProxyPassword = "";
229 public string EncryptProxyPassword
233 var pwd = this.ProxyPassword;
234 if (MyCommon.IsNullOrEmpty(pwd)) pwd = "";
239 return MyCommon.EncryptString(pwd);
255 if (MyCommon.IsNullOrEmpty(pwd)) pwd = "";
260 pwd = MyCommon.DecryptString(pwd);
267 this.ProxyPassword = pwd;
272 /// 絵文字の表示に Twemoji (https://github.com/twitter/twemoji) を使用するか
274 public bool UseTwemoji = true;
277 /// 指定されたスケールと SettingLocal.ScaleDimension のスケールとの拡大比を返します
279 public SizeF GetConfigScaleFactor(SizeF currentSizeDimension)
281 currentSizeDimension.Width / this.ScaleDimension.Width,
282 currentSizeDimension.Height / this.ScaleDimension.Height);