sbILocalDatabaseSmartMediaList.idl
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 
33 #include "nsISupports.idl"
34 #include "sbIMediaList.idl"
35 
36 interface sbIPropertyOperator;
38 
43 [scriptable, uuid(39b60b98-1b65-4e6e-866c-25b88127f8ad)]
45 {
49  readonly attribute AString propertyID;
50 
55  readonly attribute sbIPropertyOperator operator;
56 
61  readonly attribute AString leftValue;
62 
69  readonly attribute AString rightValue;
70 
78  readonly attribute AString displayUnit;
79 };
80 
81 [scriptable, function, uuid(4b3f9a5b-44d5-4384-8f4d-6f953013f877)]
83 {
84  void onRebuild(in sbILocalDatabaseSmartMediaList aSmartMediaList);
85 };
86 
87 
97 [scriptable, uuid(908211a1-2466-4642-bab9-75b228ff1532)]
99 {
100  const unsigned long MATCH_TYPE_ANY = 0;
101  const unsigned long MATCH_TYPE_ALL = 1;
102  const unsigned long MATCH_TYPE_NONE = 2;
103 
104  const unsigned long LIMIT_TYPE_NONE = 0;
105  const unsigned long LIMIT_TYPE_ITEMS = 1;
106  const unsigned long LIMIT_TYPE_USECS = 2;
107  const unsigned long LIMIT_TYPE_BYTES = 3;
108 
109  const unsigned long NOTEXISTS_ASZERO = 0;
110  const unsigned long NOTEXISTS_ASNULL = 1;
111 
115  attribute unsigned long matchType;
116 
120  readonly attribute unsigned long conditionCount;
121 
125  attribute unsigned long limitType;
126 
130  attribute unsigned long long limit;
131 
135  attribute AString selectPropertyID;
136 
141  attribute boolean selectDirection;
142 
146  attribute boolean randomSelection;
147 
152  attribute boolean autoUpdate;
153 
163  attribute unsigned long notExistsMode;
164 
169  appendCondition(in AString aPropertyID,
170  in sbIPropertyOperator aOperator,
171  in AString aLeftValue,
172  in AString aRightValue,
173  in AString aDisplayUnit);
174 
178  void removeConditionAt(in unsigned long aConditionIndex);
179 
185  getConditionAt(in unsigned long aConditionIndex);
186 
190  void clearConditions();
191 
196  void rebuild();
197 
200 
205  attribute AString sourceLibraryGuid;
206 };
readonly attribute AString rightValue
The right value for this condition. This value is only used in conjunction with the BETWEEN operator...
readonly attribute AString displayUnit
The unit used to display the left and right values for this condition. This is purely for display pur...
[USER CODE SHOULD NOT REFERENCE THIS CLASS]
Definition of the sbIMediaList interface.
[USER CODE SHOULD NOT REFERENCE THIS CLASS]
attribute boolean selectDirection
Direction to sort the selection property, true for ascending, false for descending.
attribute AString selectPropertyID
Property to select limited results by.
readonly attribute unsigned long conditionCount
The number of conditions added to this smart playlist.
attribute boolean autoUpdate
Whether this smart media list updates automatically upon changes to its source library.
var uuid
A brief description of the contents of this interface.
void onRebuild(in sbILocalDatabaseSmartMediaList aSmartMediaList)
attribute unsigned long limitType
Type of limit to use.
void rebuild()
Rebuild the smart media list contents from the conditions specificied. You should call this after you...
void clearConditions()
Clear all conditions.
An interface to represent an operator that may act upon a property.
void addSmartMediaListListener(in sbILocalDatabaseSmartMediaListListener aListener)
sbILocalDatabaseSmartMediaListCondition appendCondition(in AString aPropertyID, in sbIPropertyOperator aOperator, in AString aLeftValue, in AString aRightValue, in AString aDisplayUnit)
Add a condition or limiting condition.
sbILocalDatabaseSmartMediaListCondition getConditionAt(in unsigned long aConditionIndex)
Get the condition at the specified index. Indexes start at 0. The last item is at conditionCount - 1...
attribute AString sourceLibraryGuid
The guid of the source library (by default, the main library). Change this to select a different sour...
void removeSmartMediaListListener(in sbILocalDatabaseSmartMediaListListener aListener)
attribute unsigned long notExistsMode
How to handle non-existent properties:
readonly attribute AString leftValue
The left value for this condition. Only the operator BETWEEN requires a rightValue as well...
attribute boolean randomSelection
Randomly select the items out of the entire result set.
void removeConditionAt(in unsigned long aConditionIndex)
Remove a condition.
attribute unsigned long matchType
Match any or all conditions.
attribute unsigned long long limit
Value to apply to the limit type.
readonly attribute AString propertyID
The ID of the property used in this condition.