sbAbstractPropertyBuilder.h
Go to the documentation of this file.
1 /*
2 //
3 // BEGIN SONGBIRD GPL
4 //
5 // This file is part of the Songbird web player.
6 //
7 // Copyright(c) 2005-2008 POTI, Inc.
8 // http://songbirdnest.com
9 //
10 // This file may be licensed under the terms of of the
11 // GNU General Public License Version 2 (the "GPL").
12 //
13 // Software distributed under the License is distributed
14 // on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either
15 // express or implied. See the GPL for the specific language
16 // governing rights and limitations.
17 //
18 // You should have received a copy of the GPL along with this
19 // program. If not, go to http://www.gnu.org/licenses/gpl.html
20 // or write to the Free Software Foundation, Inc.,
21 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 //
23 // END SONGBIRD GPL
24 //
25 */
26 
27 #ifndef __SBABSTRACTPROPERTYBUILDER_H__
28 #define __SBABSTRACTPROPERTYBUILDER_H__
29 
30 #include <sbIPropertyBuilder.h>
31 
32 #include <nsCOMPtr.h>
33 #include <nsStringGlue.h>
34 #include <nsIStringBundle.h>
35 
36 #define NS_FORWARD_SBIPROPERTYBUILDER_NO_GET(_to) \
37  NS_IMETHOD GetPropertyID(nsAString & aPropertyID) { return _to GetPropertyID(aPropertyID); } \
38  NS_IMETHOD SetPropertyID(const nsAString & aPropertyID) { return _to SetPropertyID(aPropertyID); } \
39  NS_IMETHOD GetDisplayName(nsAString & aDisplayName) { return _to GetDisplayName(aDisplayName); } \
40  NS_IMETHOD SetDisplayName(const nsAString & aDisplayName) { return _to SetDisplayName(aDisplayName); } \
41  NS_IMETHOD GetDisplayNameKey(nsAString & aDisplayNameKey) { return _to GetDisplayNameKey(aDisplayNameKey); } \
42  NS_IMETHOD SetDisplayNameKey(const nsAString & aDisplayNameKey) { return _to SetDisplayNameKey(aDisplayNameKey); } \
43  NS_IMETHOD GetUserViewable(PRBool * aUserViewable) { return _to GetUserViewable(aUserViewable); } \
44  NS_IMETHOD SetUserViewable(PRBool aUserViewable) { return _to SetUserViewable(aUserViewable); } \
45  NS_IMETHOD GetUserEditable(PRBool * aUserEditable) { return _to GetUserEditable(aUserEditable); } \
46  NS_IMETHOD SetUserEditable(PRBool aUserEditable) { return _to SetUserEditable(aUserEditable); } \
47  NS_IMETHOD GetRemoteReadable(PRBool * aRemoteReadable) { return _to GetRemoteReadable(aRemoteReadable); } \
48  NS_IMETHOD SetRemoteReadable(PRBool aRemoteReadable) { return _to SetRemoteReadable(aRemoteReadable); } \
49  NS_IMETHOD GetRemoteWritable(PRBool * aRemoteWritable) { return _to GetRemoteWritable(aRemoteWritable); } \
50  NS_IMETHOD SetRemoteWritable(PRBool aRemoteWritable) { return _to SetRemoteWritable(aRemoteWritable); }
51 
53 {
54 public:
55 
57  NS_DECL_SBIPROPERTYBUILDER
58 
61 
62  virtual nsresult Init();
63 
64  static nsresult GetStringFromName(nsIStringBundle* aBundle,
65  const nsAString& aName,
66  nsAString& _retval);
67  static nsresult CreateBundle(const char* aURLSpec,
68  nsIStringBundle** _retval);
69 
70 protected:
71 
72  nsresult GetFinalDisplayName(nsAString& aDisplayName);
73 
74  nsCOMPtr<nsIStringBundle> mBundle;
75 
76  nsString mPropertyID;
77  nsString mDisplayName;
78  nsString mDisplayNameKey;
79  PRPackedBool mUserViewable;
80  PRPackedBool mUserEditable;
81  PRPackedBool mRemoteReadable;
82  PRPackedBool mRemoteWritable;
83 };
84 
85 #endif /* __SBABSTRACTPROPERTYBUILDER_H__ */
86 
nsresult GetFinalDisplayName(nsAString &aDisplayName)
nsCOMPtr< nsIStringBundle > mBundle
_updateCookies aName
static nsresult CreateBundle(const char *aURLSpec, nsIStringBundle **_retval)
NS_DECL_ISUPPORTS NS_DECL_SBIPROPERTYBUILDER sbAbstractPropertyBuilder()
static nsresult GetStringFromName(nsIStringBundle *aBundle, const nsAString &aName, nsAString &_retval)