sbImagePropertyInfo.cpp
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 #include "sbImagePropertyInfo.h"
28 #include "sbStandardOperators.h"
29 
30 #include <sbIPropertyArray.h>
31 #include <sbIPropertyManager.h>
32 #include <nsITreeView.h>
33 
38 
39 sbImagePropertyInfo::sbImagePropertyInfo(const nsAString& aPropertyID,
40  const nsAString& aDisplayName,
41  const nsAString& aLocalizationKey,
42  const PRBool aRemoteReadable,
43  const PRBool aRemoteWritable,
44  const PRBool aUserViewable,
45  const PRBool aUserEditable)
46 {
47  mID = aPropertyID;
48  mDisplayName = aDisplayName;
49  mLocalizationKey = aLocalizationKey;
50  mUserViewable = aUserViewable;
51  mUserEditable = aUserEditable;
52  mRemoteReadable = aRemoteReadable;
53  mRemoteWritable = aRemoteWritable;
54  mType.AssignLiteral("image");
55  mSuppressSelect = PR_TRUE;
56 }
57 
58 nsresult
60 {
61  nsresult rv;
62 
64  NS_ENSURE_SUCCESS(rv, rv);
65 
66  return NS_OK;
67 }
68 
69 // sbITreeViewPropertyInfo
70 
71 NS_IMETHODIMP
72 sbImagePropertyInfo::GetImageSrc(const nsAString& aValue,
73  nsAString& _retval)
74 {
75  _retval = aValue;
76  return NS_OK;
77 }
78 
79 NS_IMETHODIMP
80 sbImagePropertyInfo::GetProgressMode(const nsAString& aValue,
81  PRInt32* _retval)
82 {
83  NS_ENSURE_ARG_POINTER(_retval);
84  *_retval = nsITreeView::PROGRESS_NONE;
85  return NS_OK;
86 }
87 
88 NS_IMETHODIMP
89 sbImagePropertyInfo::GetCellValue(const nsAString& aValue,
90  nsAString& _retval)
91 {
92  _retval.Truncate();
93  return NS_OK;
94 }
95 
96 NS_IMETHODIMP
97 sbImagePropertyInfo::GetRowProperties(const nsAString& aValue,
98  nsAString& _retval)
99 {
100  _retval.Truncate();
101  return NS_OK;
102 }
103 
104 NS_IMETHODIMP
105 sbImagePropertyInfo::GetCellProperties(const nsAString& aValue,
106  nsAString& _retval)
107 {
108  _retval.AssignLiteral("image");
109  return NS_OK;
110 }
111 
112 NS_IMETHODIMP
113 sbImagePropertyInfo::GetColumnType(nsAString& _retval)
114 {
115  _retval.AssignLiteral("text");
116  return NS_OK;
117 }
118 
119 // sbIClickablePropertyInfo
120 
121 NS_IMETHODIMP
122 sbImagePropertyInfo::GetSuppressSelect(PRBool* aSuppressSelect)
123 {
124  NS_ENSURE_ARG_POINTER(aSuppressSelect);
125  *aSuppressSelect = mSuppressSelect;
126  return NS_OK;
127 }
128 
129 NS_IMETHODIMP
130 sbImagePropertyInfo::SetSuppressSelect(PRBool aSuppressSelect)
131 {
132  mSuppressSelect = aSuppressSelect;
133  return NS_OK;
134 }
135 
136 NS_IMETHODIMP
137 sbImagePropertyInfo::IsDisabled(const nsAString& aCurrentValue,
138  PRBool* _retval)
139 {
140  NS_ENSURE_ARG_POINTER(_retval);
141  *_retval = PR_FALSE;
142  return NS_OK;
143 }
144 
145 NS_IMETHODIMP
146 sbImagePropertyInfo::HitTest(const nsAString& aCurrentValue,
147  const nsAString& aPart,
148  PRUint32 aBoxWidth,
149  PRUint32 aBoxHeight,
150  PRUint32 aMouseX,
151  PRUint32 aMouseY,
152  PRBool* _retval)
153 {
154  NS_ENSURE_ARG_POINTER(_retval);
155  *_retval = aPart.EqualsLiteral("image");
156  return NS_OK;
157 }
158 
159 NS_IMETHODIMP
160 sbImagePropertyInfo::GetValueForClick(const nsAString& aCurrentValue,
161  PRUint32 aBoxWidth,
162  PRUint32 aBoxHeight,
163  PRUint32 aMouseX,
164  PRUint32 aMouseY,
165  nsAString& _retval)
166 {
167  return NS_ERROR_NOT_IMPLEMENTED;
168 }
169 
170 /* boolean onClick (in sbIMediaItem aItem,
171  [optional] in nsISupports aEvent,
172  [optional] in nsISupports aContext); */
173 NS_IMETHODIMP
174 sbImagePropertyInfo::OnClick(sbIMediaItem *aItem,
175  nsISupports *aEvent,
176  nsISupports *aContext,
177  PRBool *_retval NS_OUTPARAM)
178 {
179  NS_ENSURE_ARG_POINTER(_retval);
180  *_retval = PR_FALSE;
181  return NS_OK;
182 }
183 
184 // sbIPropertyInfo
185 
186 NS_IMETHODIMP
187 sbImagePropertyInfo::Format(const nsAString& aValue,
188  nsAString& _retval)
189 {
190  _retval.Truncate();
191  return NS_OK;
192 }
193 
NS_IMPL_ISUPPORTS_INHERITED2(sbImagePropertyInfo, sbImmutablePropertyInfo, sbIClickablePropertyInfo, sbITreeViewPropertyInfo) sbImagePropertyInfo
return NS_OK
onPageChanged aValue
Definition: FeedWriter.js:1395
The property information specific to clickable properties.
NS_IMETHOD Format(const nsAString &aValue, nsAString &_retval)
Interface that defines a single item of media in the system.