00001 /*MT* 00002 00003 MediaTomb - http://www.mediatomb.cc/ 00004 00005 config_options.h - this file is part of MediaTomb. 00006 00007 Copyright (C) 2005 Gena Batyan <bgeradz@mediatomb.cc>, 00008 Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc> 00009 00010 Copyright (C) 2006-2010 Gena Batyan <bgeradz@mediatomb.cc>, 00011 Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc>, 00012 Leonhard Wimmer <leo@mediatomb.cc> 00013 00014 MediaTomb is free software; you can redistribute it and/or modify 00015 it under the terms of the GNU General Public License version 2 00016 as published by the Free Software Foundation. 00017 00018 MediaTomb is distributed in the hope that it will be useful, 00019 but WITHOUT ANY WARRANTY; without even the implied warranty of 00020 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00021 GNU General Public License for more details. 00022 00023 You should have received a copy of the GNU General Public License 00024 version 2 along with MediaTomb; if not, write to the Free Software 00025 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 00026 00027 $Id: config_options.h 2081 2010-03-23 20:18:00Z lww $ 00028 */ 00029 00032 00033 #ifndef __CONFIG_OPTIONS_H__ 00034 #define __CONFIG_OPTIONS_H__ 00035 00036 #include "zmmf/zmmf.h" 00037 #include "exceptions.h" 00038 #include "autoscan.h" 00039 #include "object_dictionary.h" 00040 00041 #ifdef EXTERNAL_TRANSCODING 00042 #include "transcoding/transcoding.h" 00043 #endif 00044 00045 class ConfigOption : public zmm::Object 00046 { 00047 public: 00048 virtual zmm::String getOption() 00049 { 00050 assert(0); 00051 throw _Exception(_("Wrong option type")); 00052 }; 00053 00054 virtual int getIntOption() 00055 { 00056 assert(0); 00057 throw _Exception(_("Wrong option type")); 00058 }; 00059 00060 virtual bool getBoolOption() 00061 { 00062 assert(0); 00063 throw _Exception(_("Wrong option type")); 00064 }; 00065 00066 00067 virtual zmm::Ref<Dictionary> getDictionaryOption() 00068 { 00069 assert(0); 00070 throw _Exception(_("Wrong option type")); 00071 }; 00072 00073 virtual zmm::Ref<AutoscanList> getAutoscanListOption() 00074 { 00075 assert(0); 00076 throw _Exception(_("Wrong option type")); 00077 }; 00078 00079 virtual zmm::Ref<zmm::Array<zmm::StringBase> > getStringArrayOption() 00080 { 00081 assert(0); 00082 throw _Exception(_("Wrong option type")); 00083 }; 00084 #ifdef EXTERNAL_TRANSCODING 00085 virtual zmm::Ref<TranscodingProfileList> getTranscodingProfileListOption() 00086 { 00087 assert(0); 00088 throw _Exception(_("Wrong option type")); 00089 }; 00090 #endif 00091 #ifdef ONLINE_SERVICES 00092 virtual zmm::Ref<zmm::Array<zmm::Object> > getObjectArrayOption() 00093 { 00094 assert(0); 00095 throw _Exception(_("Wrong option type")); 00096 } 00097 #endif 00098 virtual zmm::Ref<ObjectDictionary<zmm::Object> > getObjectDictionaryOption() 00099 { 00100 assert(0); 00101 throw _Exception(_("Wrong option type")); 00102 } 00103 }; 00104 00105 class Option : public ConfigOption 00106 { 00107 public: 00108 Option(zmm::String option) { this->option = option; }; 00109 00110 virtual zmm::String getOption() { return option; }; 00111 00112 protected: 00113 zmm::String option; 00114 }; 00115 00116 class IntOption : public ConfigOption 00117 { 00118 public: 00119 IntOption(int option) { this->option = option; }; 00120 00121 virtual int getIntOption() { return option; }; 00122 00123 protected: 00124 int option; 00125 }; 00126 00127 class BoolOption : public ConfigOption 00128 { 00129 public: 00130 BoolOption(bool option) { this->option = option; }; 00131 00132 virtual bool getBoolOption() { return option; }; 00133 00134 protected: 00135 BoolOption() {}; 00136 bool option; 00137 }; 00138 00139 00140 class DictionaryOption : public ConfigOption 00141 { 00142 public: 00143 DictionaryOption(zmm::Ref<Dictionary> option) { this->option = option; }; 00144 00145 virtual zmm::Ref<Dictionary> getDictionaryOption() { return option; }; 00146 00147 protected: 00148 zmm::Ref<Dictionary> option; 00149 }; 00150 00151 class StringArrayOption : public ConfigOption 00152 { 00153 public: 00154 StringArrayOption(zmm::Ref<zmm::Array<zmm::StringBase> > option) 00155 { 00156 this->option = option; 00157 }; 00158 00159 virtual zmm::Ref<zmm::Array<zmm::StringBase> > getStringArrayOption() 00160 { 00161 return option; 00162 }; 00163 00164 protected: 00165 zmm::Ref<zmm::Array<zmm::StringBase> > option; 00166 }; 00167 00168 class AutoscanListOption : public ConfigOption 00169 { 00170 public: 00171 AutoscanListOption(zmm::Ref<AutoscanList> option) 00172 { 00173 this->option = option; 00174 }; 00175 00176 virtual zmm::Ref<AutoscanList> getAutoscanListOption() { return option; }; 00177 00178 protected: 00179 zmm::Ref<AutoscanList> option; 00180 }; 00181 00182 #ifdef EXTERNAL_TRANSCODING 00183 class TranscodingProfileListOption : public ConfigOption 00184 { 00185 public: 00186 TranscodingProfileListOption(zmm::Ref<TranscodingProfileList> option) 00187 { 00188 this->option = option; 00189 }; 00190 00191 virtual zmm::Ref<TranscodingProfileList> getTranscodingProfileListOption() 00192 { 00193 return option; 00194 }; 00195 protected: 00196 zmm::Ref<TranscodingProfileList> option; 00197 }; 00198 #endif//EXTERNAL_TRANSCODING 00199 00200 #ifdef ONLINE_SERVICES 00201 class ObjectArrayOption : public ConfigOption 00202 { 00203 public: 00204 ObjectArrayOption(zmm::Ref<zmm::Array<zmm::Object> > option) 00205 { 00206 this->option = option; 00207 }; 00208 00209 virtual zmm::Ref<zmm::Array<zmm::Object> > getObjectArrayOption() 00210 { 00211 return option; 00212 }; 00213 00214 protected: 00215 zmm::Ref<zmm::Array<zmm::Object> > option; 00216 }; 00217 00218 #endif//ONLINE_SERVICES 00219 00220 class ObjectDictionaryOption : public ConfigOption 00221 { 00222 public: 00223 ObjectDictionaryOption(zmm::Ref<ObjectDictionary<zmm::Object> > option) 00224 { 00225 this->option = option; 00226 }; 00227 00228 virtual zmm::Ref<ObjectDictionary<zmm::Object> > getObjectDictionaryOption() 00229 { 00230 return option; 00231 }; 00232 protected: 00233 zmm::Ref<ObjectDictionary<zmm::Object> > option; 00234 }; 00235 00236 #endif // __CONFIG_MANAGER_H__
1.6.1