00001
00002
00003
00004
00005 #ifndef SUPPORT_ICATALOGPERMISSIONS_H
00006 #define SUPPORT_ICATALOGPERMISSIONS_H
00007
00008 #include <support/IInterface.h>
00009 #include <support/Binder.h>
00010 #include <support/Context.h>
00011 #include <support/String.h>
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00029 #include <support/ICatalog.h>
00030
00031
00032
00033 #if _SUPPORTS_NAMESPACE
00034 namespace palmos {
00035 namespace support {
00036 #endif
00037
00039
00049 class ICatalogPermissions : public IInterface
00050 {
00051 public:
00052 B_DECLARE_META_INTERFACE(CatalogPermissions)
00053
00054
00055
00056
00057 virtual bool Writable() const = 0;
00058 virtual void SetWritable(bool value) = 0;
00059
00060
00061
00063 virtual status_t HideEntry(const SString& name) = 0;
00064
00066 virtual status_t ShowEntry(const SString& name) = 0;
00067
00069
00072 virtual status_t OverlayEntry(const SString& location, const SValue& item) = 0;
00073
00075 virtual status_t RestoreEntry(const SString& location) = 0;
00076
00077 virtual status_t Merge(const sptr<ICatalog>& catalog) = 0;
00078
00079
00080 status_t LinkCatalogPermissions(const sptr<IBinder>& to, const SValue& mappings, uint32_t flags = 0)
00081 {
00082 return AsBinder()->Link(to, mappings, flags);
00083 }
00084 status_t UnlinkCatalogPermissions(const sptr<IBinder>& to, const SValue& mappings, uint32_t flags = 0)
00085 {
00086 return AsBinder()->Unlink(to, mappings, flags);
00087 }
00088
00089 protected:
00090 ICatalogPermissions() { }
00091 virtual ~ICatalogPermissions();
00092
00093 private:
00094
00095 ICatalogPermissions(const ICatalogPermissions& o);
00096 ICatalogPermissions& operator=(const ICatalogPermissions& o);
00097 };
00098
00099
00100
00101
00102 class BnCatalogPermissions : public ICatalogPermissions, public BBinder
00103 {
00104 public:
00105 virtual SValue Inspect(const sptr<IBinder>& caller, const SValue& which, uint32_t flags = 0);
00106 virtual sptr<IInterface> InterfaceFor(const SValue& descriptor, uint32_t flags = 0);
00107
00108
00109 public:
00110 void PushWritable(bool value);
00111
00112 protected:
00113 BnCatalogPermissions();
00114 BnCatalogPermissions(const SContext& context);
00115 virtual ~BnCatalogPermissions();
00116
00117 virtual sptr<IBinder> AsBinderImpl();
00118 virtual sptr<const IBinder> AsBinderImpl() const;
00119
00120
00121 virtual status_t HandleEffect(const SValue &, const SValue &, const SValue &, SValue *);
00122 virtual status_t Transact(uint32_t code, SParcel& data, SParcel* reply, uint32_t flags);
00123
00124 private:
00125 BnCatalogPermissions(const BnCatalogPermissions& o);
00126 BnCatalogPermissions& operator=(const BnCatalogPermissions& o);
00127 };
00128
00129
00130 #if _SUPPORTS_NAMESPACE
00131 } }
00132 #endif
00133
00134
00135
00136
00137 #endif // SUPPORT_ICATALOGPERMISSIONS_H
00138