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 = "";
135 public bool PlaySound = false;
136 public bool UnreadManage = true;
139 /// 片思い表示。trueなら片思い表示する
141 public bool OneWayLove = true;
143 public MyCommon.NameBalloonEnum NameBalloon = MyCommon.NameBalloonEnum.NickName;
144 public bool PostCtrlEnter = false;
145 public bool PostShiftEnter = false;
146 public int CountApi = 60;
147 public int CountApiReply = 40;
148 public bool PostAndGet = true;
149 public bool DispUsername = false;
150 public bool MinimizeToTray = false;
151 public bool CloseToExit = false;
152 public MyCommon.DispTitleEnum DispLatestPost = MyCommon.DispTitleEnum.Post;
153 public bool SortOrderLock = false;
158 public bool ViewTabBottom = true;
160 public bool TinyUrlResolve = true;
161 public bool StartupVersion = true;
162 public bool StartupFollowers = true;
163 public bool RestrictFavCheck = false;
164 public bool AlwaysTop = false;
165 public string CultureCode = "";
166 public bool UrlConvertAuto = false;
167 public int SortColumn = 3;
168 public int SortOrder = 1;
169 public bool IsMonospace = false;
170 public bool ReadOldPosts = false;
171 public string Language = "OS";
172 public bool Nicoms = false;
173 public List<string> HashTags = new List<string>();
174 public string HashSelected = "";
175 public bool HashIsPermanent = false;
176 public bool HashIsHead = false;
177 public bool HashIsNotAddToAtReply = true;
178 public bool PreviewEnable = true;
179 public bool StatusAreaAtBottom = true;
181 public MyCommon.UrlConverter AutoShortUrlFirst = MyCommon.UrlConverter.Uxnu;
182 public bool UseUnreadStyle = true;
183 public string DateTimeFormat = "yyyy/MM/dd H:mm:ss";
184 public int DefaultTimeOut = 20;
185 public bool RetweetNoConfirm = false;
186 public bool LimitBalloon = false;
187 public bool TabIconDisp = true;
188 public MyCommon.REPLY_ICONSTATE ReplyIconState = MyCommon.REPLY_ICONSTATE.StaticIcon;
189 public bool WideSpaceConvert = true;
190 public bool ReadOwnPost = false;
191 public bool GetFav = true;
192 public string BilyUser = "";
193 public string BitlyPwd = "";
194 public bool ShowGrid = false;
195 public bool UseAtIdSupplement = true;
196 public bool UseHashSupplement = true;
197 public string TwitterUrl = "api.twitter.com";
198 public bool HotkeyEnabled = false;
199 public Keys HotkeyModifier = Keys.None;
200 public Keys HotkeyKey = Keys.None;
201 public int HotkeyValue = 0;
202 public bool BlinkNewMentions = false;
203 public bool FocusLockToStatusText = false;
204 public bool UseAdditionalCount = false;
205 public int MoreCountApi = 200;
206 public int FirstCountApi = 100;
207 public int SearchCountApi = 100;
208 public int FavoritesCountApi = 40;
209 public string TrackWord = "";
210 public bool AllAtReply = false;
211 public bool UserstreamStartup = true;
212 public int UserstreamPeriod = 0;
213 public int UserTimelineCountApi = 20;
214 public int UserTimelinePeriod = 600;
215 public bool OpenUserTimeline = true;
216 public int ListCountApi = 100;
217 public int UseImageService = 0;
218 public string UseImageServiceName = "";
219 public int ListDoubleClickAction = 0;
220 public string UserAppointUrl = "";
221 public bool HideDuplicatedRetweets = false;
222 public bool EnableImgAzyobuziNet = true;
223 public bool ImgAzyobuziNetDisabledInDM = true;
224 public int MapThumbnailHeight = 200;
225 public int MapThumbnailWidth = 200;
226 public int MapThumbnailZoom = 15;
227 public MapProvider MapThumbnailProvider = MapProvider.OpenStreetMap;
228 public bool IsListsIncludeRts = false;
229 public bool TabMouseLock = false;
230 public bool IsRemoveSameEvent = false;
231 public bool IsUseNotifyGrowl = false;
234 public class UserAccount
236 public string Username = "";
237 public long UserId = 0;
238 public string Token = "";
240 public string TokenSecret = "";
241 public string EncryptTokenSecret
243 get { return Encrypt(TokenSecret); }
244 set { TokenSecret = Decrypt(value); }
246 private string Encrypt(string password)
248 if (String.IsNullOrEmpty(password)) password = "";
249 if (password.Length > 0)
253 return MyCommon.EncryptString(password);
265 private string Decrypt(string password)
267 if (String.IsNullOrEmpty(password)) password = "";
268 if (password.Length > 0)
272 password = MyCommon.DecryptString(password);
281 public override string ToString()
283 return this.Username;