sbImageLabelLinkPropertyInfo.h
Go to the documentation of this file.
1 /*
2  *=BEGIN SONGBIRD GPL
3  *
4  * This file is part of the Songbird web player.
5  *
6  * Copyright(c) 2005-2010 POTI, Inc.
7  * http://www.songbirdnest.com
8  *
9  * This file may be licensed under the terms of of the
10  * GNU General Public License Version 2 (the ``GPL'').
11  *
12  * Software distributed under the License is distributed
13  * on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either
14  * express or implied. See the GPL for the specific language
15  * governing rights and limitations.
16  *
17  * You should have received a copy of the GPL along with this
18  * program. If not, go to http://www.gnu.org/licenses/gpl.html
19  * or write to the Free Software Foundation, Inc.,
20  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21  *
22  *=END SONGBIRD GPL
23  */
24 
25 #ifndef __SBIMAGELABELLINKPROPERTYINFO_H__
26 #define __SBIMAGELABELLINKPROPERTYINFO_H__
27 
29 
30 #include <sbIClickablePropertyInfo.h>
31 #include <sbIImageLinkPropertyInfo.h>
32 #include <sbIPropertyBuilder.h>
33 #include <sbIPropertyManager.h>
34 #include <sbITreeViewPropertyInfo.h>
35 
36 #include <nsClassHashtable.h>
37 #include <nsCOMPtr.h>
38 #include <nsStringGlue.h>
39 
41 
44 {
45  NS_DECL_ISUPPORTS_INHERITED
46  NS_DECL_SBIIMAGELINKPROPERTYINFO
47  NS_DECL_SBIIMAGELABELLINKPROPERTYINFO
48 
49 public:
50  typedef nsClassHashtable<nsCStringHashKey, nsCString> ImageMap_t;
51  typedef nsClassHashtable<nsCStringHashKey, nsString> LabelMap_t;
52  typedef nsTHashtable<nsISupportsHashKey> InterfaceSet_t;
53 
54 public:
57 
58 public:
59  nsresult Init();
60  nsresult Init(ImageMap_t *&aImages,
61  LabelMap_t *&aLabels,
62  InterfaceSet_t *&aClickHandlers);
63 
64  /* setters because I think a billion constructor arguments is ugly */
65  NS_IMETHOD SetPropertyID(const nsAString& aPropertyID);
66  NS_IMETHOD SetDisplayName(const nsAString& aDisplayName);
67  NS_IMETHOD SetLocalizationKey(const nsAString& aLocalizationKey);
68  NS_IMETHOD SetRemoteReadable(PRBool aRemoteReadable);
69  NS_IMETHOD SetRemoteWritable(PRBool aRemoteWritable);
70  NS_IMETHOD SetUserViewable(PRBool aUserViewable);
71  NS_IMETHOD SetUserEditable(PRBool aUserEditable);
72  NS_IMETHOD SetUrlPropertyID(const nsAString& aUrlPropertyID);
73 
74  /* partial implementation of sbITreeViewPropertyInfo */
75  NS_IMETHOD GetImageSrc(const nsAString& aValue, nsAString& _retval);
76  NS_IMETHOD GetCellProperties(const nsAString& aValue, nsAString& _retval);
77 
78  /* partial implementation of sbIClickablePropertyInfo */
79  NS_IMETHOD HitTest(const nsAString& aCurrentValue,
80  const nsAString& aPart,
81  PRUint32 aBoxWidth,
82  PRUint32 aBoxHeight,
83  PRUint32 aMouseX,
84  PRUint32 aMouseY,
85  PRBool* _retval);
86  NS_IMETHOD OnClick(sbIMediaItem *aItem,
87  nsISupports *aEvent,
88  nsISupports *aContext,
89  PRBool *_retval);
90 
91  /* partial implementation of sbIPropertyInfo */
92  NS_IMETHOD Format(const nsAString& aValue, nsAString& _retval);
93 private:
94  ImageMap_t *mImages;
95  LabelMap_t *mLabels;
96  InterfaceSet_t *mClickHandlers;
97 };
98 
99 #endif /* __SBIMAGELABELLINKPROPERTYINFO_H__ */
100 
onPageChanged aValue
Definition: FeedWriter.js:1395
Interface that defines a single item of media in the system.