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.
28 using System.Xml.Serialization;
29 using System.Collections.Generic;
30 using System.Windows.Forms;
31 using OpenTween.Thumbnail;
35 public class SettingCommon : SettingBase<SettingCommon>
37 public static SettingCommon Instance { get; internal set; }
39 static SettingCommon()
41 Instance = new SettingCommon();
44 #region "Settingクラス基本"
45 public static SettingCommon Load()
47 return LoadSettings();
56 public List<UserAccount> UserAccounts;
57 public string UserName = "";
60 public string Password = "";
61 public string EncryptPassword
63 get { return Encrypt(Password); }
64 set { Password = Decrypt(value); }
67 public string Token = "";
69 public string TokenSecret = "";
70 public string EncryptTokenSecret
72 get { return Encrypt(TokenSecret); }
73 set { TokenSecret = Decrypt(value); }
76 private string Encrypt(string password)
78 if (String.IsNullOrEmpty(password)) password = "";
79 if (password.Length > 0)
83 return MyCommon.EncryptString(password);
95 private string Decrypt(string password)
97 if (String.IsNullOrEmpty(password)) password = "";
98 if (password.Length > 0)
102 password = MyCommon.DecryptString(password);
112 public long UserId = 0;
113 public List<string> TabList;
114 public int TimelinePeriod = 90;
115 public int ReplyPeriod = 180;
116 public int DMPeriod = 600;
117 public int PubSearchPeriod = 180;
118 public int ListsPeriod = 180;
121 /// 起動時読み込み分を既読にするか。trueなら既読として処理
123 public bool Read = true;
125 public bool ListLock = false;
126 public MyCommon.IconSizes IconSize = MyCommon.IconSizes.Icon16;
127 public bool NewAllPop = true;
128 public bool EventNotifyEnabled = true;
129 public MyCommon.EVENTTYPE EventNotifyFlag = MyCommon.EVENTTYPE.All;
130 public MyCommon.EVENTTYPE IsMyEventNotifyFlag = MyCommon.EVENTTYPE.All;
131 public bool ForceEventNotify = false;
132 public bool FavEventUnread = true;
133 public string TranslateLanguage = Properties.Resources.TranslateDefaultLanguage;
134 public string EventSoundFile = "";
137 /// サウンド再生(タブ別設定より優先)
139 public bool PlaySound = false;
142 /// 未読管理。trueなら未読管理する
144 public bool UnreadManage = true;
147 /// 片思い表示。trueなら片思い表示する
149 public bool OneWayLove = true;
151 public MyCommon.NameBalloonEnum NameBalloon = MyCommon.NameBalloonEnum.NickName;
152 public bool PostCtrlEnter = false;
153 public bool PostShiftEnter = false;
154 public int CountApi = 60;
155 public int CountApiReply = 40;
156 public bool PostAndGet = true;
157 public bool DispUsername = false;
158 public bool MinimizeToTray = false;
159 public bool CloseToExit = false;
160 public MyCommon.DispTitleEnum DispLatestPost = MyCommon.DispTitleEnum.Post;
161 public bool SortOrderLock = false;
166 public bool ViewTabBottom = true;
168 public bool TinyUrlResolve = true;
169 public bool StartupVersion = true;
170 public bool StartupFollowers = true;
171 public bool RestrictFavCheck = false;
172 public bool AlwaysTop = false;
173 public string CultureCode = "";
174 public bool UrlConvertAuto = false;
175 public int SortColumn = 3;
176 public int SortOrder = 1;
177 public bool IsMonospace = false;
178 public bool ReadOldPosts = false;
179 public string Language = "OS";
180 public bool Nicoms = false;
181 public List<string> HashTags = new List<string>();
182 public string HashSelected = "";
183 public bool HashIsPermanent = false;
184 public bool HashIsHead = false;
185 public bool HashIsNotAddToAtReply = true;
186 public bool PreviewEnable = true;
187 public bool StatusAreaAtBottom = true;
189 public MyCommon.UrlConverter AutoShortUrlFirst = MyCommon.UrlConverter.Uxnu;
190 public bool UseUnreadStyle = true;
191 public string DateTimeFormat = "yyyy/MM/dd H:mm:ss";
192 public int DefaultTimeOut = 20;
193 public bool RetweetNoConfirm = false;
194 public bool LimitBalloon = false;
195 public bool TabIconDisp = true;
196 public MyCommon.REPLY_ICONSTATE ReplyIconState = MyCommon.REPLY_ICONSTATE.StaticIcon;
197 public bool WideSpaceConvert = true;
198 public bool ReadOwnPost = false;
199 public bool GetFav = true;
200 public string BilyUser = "";
201 public string BitlyPwd = "";
202 public bool ShowGrid = false;
203 public bool UseAtIdSupplement = true;
204 public bool UseHashSupplement = true;
205 public string TwitterUrl = "api.twitter.com";
206 public bool HotkeyEnabled = false;
207 public Keys HotkeyModifier = Keys.None;
208 public Keys HotkeyKey = Keys.None;
209 public int HotkeyValue = 0;
210 public bool BlinkNewMentions = false;
211 public bool FocusLockToStatusText = false;
212 public bool UseAdditionalCount = false;
213 public int MoreCountApi = 200;
214 public int FirstCountApi = 100;
215 public int SearchCountApi = 100;
216 public int FavoritesCountApi = 40;
217 public string TrackWord = "";
218 public bool AllAtReply = false;
219 public bool UserstreamStartup = true;
220 public int UserstreamPeriod = 0;
221 public int UserTimelineCountApi = 20;
222 public int UserTimelinePeriod = 600;
223 public bool OpenUserTimeline = true;
224 public int ListCountApi = 100;
225 public int UseImageService = 0;
226 public string UseImageServiceName = "";
227 public int ListDoubleClickAction = 0;
228 public string UserAppointUrl = "";
229 public bool HideDuplicatedRetweets = false;
230 public bool EnableImgAzyobuziNet = true;
231 public bool ImgAzyobuziNetDisabledInDM = true;
232 public int MapThumbnailHeight = 200;
233 public int MapThumbnailWidth = 200;
234 public int MapThumbnailZoom = 15;
235 public MapProvider MapThumbnailProvider = MapProvider.OpenStreetMap;
236 public bool IsListsIncludeRts = false;
237 public bool TabMouseLock = false;
238 public bool IsRemoveSameEvent = false;
239 public bool IsUseNotifyGrowl = false;
242 public class UserAccount
244 public string Username = "";
245 public long UserId = 0;
246 public string Token = "";
248 public string TokenSecret = "";
249 public string EncryptTokenSecret
251 get { return Encrypt(TokenSecret); }
252 set { TokenSecret = Decrypt(value); }
254 private string Encrypt(string password)
256 if (String.IsNullOrEmpty(password)) password = "";
257 if (password.Length > 0)
261 return MyCommon.EncryptString(password);
273 private string Decrypt(string password)
275 if (String.IsNullOrEmpty(password)) password = "";
276 if (password.Length > 0)
280 password = MyCommon.DecryptString(password);
289 public override string ToString()
291 return this.Username;