OSDN Git Service

OpenTween v2.4.2 リリース
[opentween/open-tween.git] / OpenTween / Setting / SettingTabs.cs
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.
9 // 
10 // This file is part of OpenTween.
11 // 
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)
15 // any later version.
16 // 
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
20 // for more details. 
21 // 
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.
26
27 #nullable enable
28
29 using System;
30 using System.Collections.Generic;
31 using System.Linq;
32 using System.Text;
33 using System.Xml.Serialization;
34 using OpenTween.Models;
35
36 namespace OpenTween
37 {
38     public class SettingTabs : SettingBase<SettingTabs>
39     {
40 #region Settingクラス基本
41         public static SettingTabs Load()
42             => LoadSettings("");
43
44         public void Save()
45             => SaveSettings(this);
46
47         public SettingTabs()
48             => this.Tabs = new List<SettingTabItem>();
49 #endregion
50
51         public List<SettingTabItem> Tabs;
52
53         [XmlType("TabClass")]
54         public class SettingTabItem
55         {
56             /// <summary>タブの表示名</summary>
57             public string TabName { get; set; } = "";
58
59             /// <summary>タブの種類</summary>
60             public MyCommon.TabUsageType TabType { get; set; }
61
62             /// <summary>未読管理を有効にする</summary>
63             public bool UnreadManage { get; set; }
64
65             /// <summary>タブを保護する</summary>
66             [XmlElement(ElementName = "Locked")] // v1.0.5で「タブを固定(Locked)」から「タブを保護(Protected)」に名称変更
67             public bool Protected { get; set; }
68
69             /// <summary>新着通知表示を有効にする</summary>
70             public bool Notify { get; set; }
71
72             /// <summary>通知音</summary>
73             public string SoundFile { get; set; } = "";
74
75             /// <summary>
76             /// 振り分けルール (<see cref="MyCommon.TabUsageType.UserDefined"/> で使用)
77             /// </summary>
78             public PostFilterRule[] FilterArray { get; set; } = Array.Empty<PostFilterRule>();
79
80             /// <summary>
81             /// 表示するユーザーのスクリーンネーム (<see cref="MyCommon.TabUsageType.UserTimeline"/> で使用)
82             /// </summary>
83             public string? User { get; set; }
84
85             /// <summary>
86             /// 検索文字列 (<see cref="MyCommon.TabUsageType.PublicSearch"/> で使用)
87             /// </summary>
88             public string SearchWords { get; set; } = "";
89
90             /// <summary>
91             /// 検索対象の言語 (<see cref="MyCommon.TabUsageType.PublicSearch"/> で使用)
92             /// </summary>
93             public string SearchLang { get; set; } = "";
94
95             /// <summary>
96             /// 表示するリスト (<see cref="MyCommon.TabUsageType.Lists"/> で使用)
97             /// </summary>
98             public ListElement? ListInfo { get; set; }
99         }
100     }
101 }