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;
36 public class SettingCommon : SettingBase<SettingCommon>
39 #region "Settingクラス基本"
40 public static SettingCommon Load()
42 return LoadSettings();
51 public List<UserAccount> UserAccounts;
52 public string UserName = "";
55 public string Password = "";
56 public string EncryptPassword
58 get { return Encrypt(Password); }
59 set { Password = Decrypt(value); }
62 public string Token = "";
64 public string TokenSecret = "";
65 public string EncryptTokenSecret
67 get { return Encrypt(TokenSecret); }
68 set { TokenSecret = Decrypt(value); }
71 private string Encrypt(string password)
73 if (String.IsNullOrEmpty(password)) password = "";
74 if (password.Length > 0)
78 return MyCommon.EncryptString(password);
90 private string Decrypt(string password)
92 if (String.IsNullOrEmpty(password)) password = "";
93 if (password.Length > 0)
97 password = MyCommon.DecryptString(password);
107 public long UserId = 0;
108 public List<string> TabList;
109 public int TimelinePeriod = 90;
110 public int ReplyPeriod = 180;
111 public int DMPeriod = 600;
112 public int PubSearchPeriod = 180;
113 public int ListsPeriod = 180;
114 public bool Read = true;
115 public bool ListLock = false;
116 public MyCommon.IconSizes IconSize = MyCommon.IconSizes.Icon16;
117 public bool NewAllPop = true;
118 public bool EventNotifyEnabled = true;
119 public MyCommon.EVENTTYPE EventNotifyFlag = MyCommon.EVENTTYPE.All;
120 public MyCommon.EVENTTYPE IsMyEventNotifyFlag = MyCommon.EVENTTYPE.All;
121 public bool ForceEventNotify = false;
122 public bool FavEventUnread = true;
123 public string TranslateLanguage = Properties.Resources.TranslateDefaultLanguage;
124 public string EventSoundFile = "";
125 public bool PlaySound = false;
126 public bool UnreadManage = true;
127 public bool OneWayLove = true;
128 public MyCommon.NameBalloonEnum NameBalloon = MyCommon.NameBalloonEnum.NickName;
129 public bool PostCtrlEnter = false;
130 public bool PostShiftEnter = false;
131 public int CountApi = 60;
132 public int CountApiReply = 40;
133 public bool PostAndGet = true;
134 public bool DispUsername = false;
135 public bool MinimizeToTray = false;
136 public bool CloseToExit = false;
137 public MyCommon.DispTitleEnum DispLatestPost = MyCommon.DispTitleEnum.Post;
138 public bool SortOrderLock = false;
143 public bool ViewTabBottom = true;
145 public bool TinyUrlResolve = true;
146 public bool StartupVersion = true;
147 public bool StartupFollowers = true;
148 public bool RestrictFavCheck = false;
149 public bool AlwaysTop = false;
150 public string CultureCode = "";
151 public bool UrlConvertAuto = false;
152 public bool Outputz = false;
153 public int SortColumn = 3;
154 public int SortOrder = 1;
155 public bool IsMonospace = false;
156 public bool ReadOldPosts = false;
157 public bool UseSsl = true;
158 public string Language = "OS";
159 public bool Nicoms = false;
160 public List<string> HashTags = new List<string>();
161 public string HashSelected = "";
162 public bool HashIsPermanent = false;
163 public bool HashIsHead = false;
164 public bool HashIsNotAddToAtReply = true;
165 public bool PreviewEnable = true;
168 public string OutputzKey = "";
169 public string EncryptOutputzKey
171 get { return Encrypt(OutputzKey); }
172 set { OutputzKey = Decrypt(value); }
175 public MyCommon.OutputzUrlmode OutputzUrlMode = MyCommon.OutputzUrlmode.twittercom;
176 public MyCommon.UrlConverter AutoShortUrlFirst = MyCommon.UrlConverter.Uxnu;
177 public bool UseUnreadStyle = true;
178 public string DateTimeFormat = "yyyy/MM/dd H:mm:ss";
179 public int DefaultTimeOut = 20;
180 public bool RetweetNoConfirm = false;
181 public bool LimitBalloon = false;
182 public bool TabIconDisp = true;
183 public MyCommon.REPLY_ICONSTATE ReplyIconState = MyCommon.REPLY_ICONSTATE.StaticIcon;
184 public bool WideSpaceConvert = true;
185 public bool ReadOwnPost = false;
186 public bool GetFav = true;
187 public string BilyUser = "";
188 public string BitlyPwd = "";
189 public bool ShowGrid = false;
190 public bool UseAtIdSupplement = true;
191 public bool UseHashSupplement = true;
192 public string TwitterUrl = "api.twitter.com";
193 public bool HotkeyEnabled = false;
194 public Keys HotkeyModifier = Keys.None;
195 public Keys HotkeyKey = Keys.None;
196 public int HotkeyValue = 0;
197 public bool BlinkNewMentions = false;
198 public bool FocusLockToStatusText = false;
199 public bool UseAdditionalCount = false;
200 public int MoreCountApi = 200;
201 public int FirstCountApi = 100;
202 public int SearchCountApi = 100;
203 public int FavoritesCountApi = 40;
204 public string TrackWord = "";
205 public bool AllAtReply = false;
206 public bool UserstreamStartup = true;
207 public int UserstreamPeriod = 0;
208 public int UserTimelineCountApi = 20;
209 public int UserTimelinePeriod = 600;
210 public bool OpenUserTimeline = true;
211 public int ListCountApi = 100;
212 public int UseImageService = 0;
213 public int ListDoubleClickAction = 0;
214 public string UserAppointUrl = "";
215 public bool HideDuplicatedRetweets = false;
216 public bool IsPreviewFoursquare = false;
217 public int MapThumbnailHeight = 200;
218 public int MapThumbnailWidth = 200;
219 public int MapThumbnailZoom = 15;
220 public MapProvider MapThumbnailProvider = MapProvider.OpenStreetMap;
221 public bool IsListsIncludeRts = false;
222 public long GAFirst = 0;
223 public long GALast = 0;
224 public bool TabMouseLock = false;
225 public bool IsRemoveSameEvent = false;
226 public bool IsUseNotifyGrowl = false;
229 public class UserAccount
231 public string Username = "";
232 public long UserId = 0;
233 public long GAFirst = 0;
234 public long GALast = 0;
235 public string Token = "";
237 public string TokenSecret = "";
238 public string EncryptTokenSecret
240 get { return Encrypt(TokenSecret); }
241 set { TokenSecret = Decrypt(value); }
243 private string Encrypt(string password)
245 if (String.IsNullOrEmpty(password)) password = "";
246 if (password.Length > 0)
250 return MyCommon.EncryptString(password);
262 private string Decrypt(string password)
264 if (String.IsNullOrEmpty(password)) password = "";
265 if (password.Length > 0)
269 password = MyCommon.DecryptString(password);
278 public override string ToString()
280 return this.Username;