2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
18 * @file FApp_AppControlRegistry.h
19 * @brief This is the header file of the _AppControlRegistry class.
22 #ifndef _FAPP_INTERNAL_APP_CONTROL_REGISTRY_H_
23 #define _FAPP_INTERNAL_APP_CONTROL_REGISTRY_H_
27 #include <FBaseObject.h>
28 #include <FBaseColArrayListT.h>
29 #include <FBaseColHashMapT.h>
30 #include <FBaseColMultiHashMapT.h>
31 #include <FAppTypes.h>
33 namespace Tizen { namespace App
40 void operator()(bundle* pBundle)
50 * @class _AppControlRegistry
51 * @brief load & store AppControl information
54 class _AppControlRegistry
55 : public Tizen::Base::Object
58 class _AppControlAliasEntry
61 _AppControlAliasEntry(const Tizen::Base::String& aId1,
62 const Tizen::Base::String& oId1,
63 const Tizen::Base::String& aId2,
64 const Tizen::Base::String& oId2)
72 const Tizen::Base::String provider;
73 const Tizen::Base::String operation;
74 const Tizen::Base::String provider2;
75 const Tizen::Base::String operation2;
78 typedef Tizen::Base::Collection::ArrayListT<_AppControlAliasEntry*> RuntimeAliasType;
79 typedef Tizen::Base::Collection::MultiHashMapT<Tizen::Base::String, _AppControlAliasEntry*> AppControlAliasList;
80 typedef Tizen::Base::Collection::HashMapT<Tizen::Base::String, Tizen::Base::String> AliasMapType;
82 _AppControlRegistry(void);
84 virtual ~_AppControlRegistry(void);
86 static _AppControlRegistry* GetInstance(void);
88 AppControl* GetTizenAppControlN(const Tizen::Base::String& aId, const Tizen::Base::String& oId) const;
90 AppControl* GetAppControlN(const Tizen::Base::String& appId, const Tizen::Base::String& operationId) const;
92 Tizen::Base::Collection::ArrayList* FindAppControlListN(const Tizen::Base::String* pOid, const Tizen::Base::String* pUri, const Tizen::Base::String* pMimeType, const Tizen::Base::String* pCategory) const;
94 const _AppControlAliasEntry* GetAppControlAliasEntry(const Tizen::Base::String& aId, const Tizen::Base::String& oId) const;
96 const _AppControlAliasEntry* GetReverseAppControlAliasEntry(const Tizen::Base::String& aId, const Tizen::Base::String& oId) const;
98 const _AppControlAliasEntry* GetReverseRuntimeAliasEntry(const Tizen::Base::String& aId, const Tizen::Base::String& oId) const;
100 AppId GetAliasAppId(const AppId& appId) const;
102 AppId GetReverseAliasAppId(const AppId& appId) const;
105 _AppControlRegistry(const _AppControlRegistry& rhs);
107 _AppControlRegistry& operator =(const _AppControlRegistry& rhs);
109 result LoadTizenAppControlRegistry(void);
111 result LoadLegacyList(void);
113 result LoadAliasList(void);
115 Tizen::Base::String GetTizenAppControlProvider(const Tizen::Base::String& appId, const Tizen::Base::String& opId) const;
118 AliasMapType __tizenList;
120 AppControlAliasList __aliasList;
122 AliasMapType __aliasAppId;
124 mutable RuntimeAliasType __runtimeAlias;
126 static _AppControlRegistry* __pSelf;
127 }; // _AppControlRegistry
131 #endif // _FAPP_INTERNAL_APP_CONTROL_REGISTRY_H_