sbILocalDatabaseGUIDArray.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 
32 #include "nsISupports.idl"
33 
34 interface nsIStringEnumerator;
35 interface nsIURI;
37 interface sbIPropertyArray;
38 
43 [scriptable, uuid(60cc270d-58f9-4cc5-a68c-d16a0139a027)]
45 {
52  void onBeforeInvalidate(in boolean aInvalidateLength);
53 
57  void onAfterInvalidate();
58 };
59 
64 [scriptable, uuid(80d33aac-dbb1-44eb-bda8-22c764ab16df)]
66 {
67  void addCachedLength(in AString aKey, in unsigned long aLength);
68  void removeCachedLength(in AString aKey);
69  unsigned long getCachedLength(in AString aKey);
70 
71  void addCachedNonNullLength(in AString aKey, in unsigned long aLength);
72  void removeCachedNonNullLength(in AString aKey);
73  unsigned long getCachedNonNullLength(in AString aKey);
74 };
75 
80 [scriptable, uuid(e1b502cc-3e00-4873-bb9b-722cd8a13e99)]
82 {
83  attribute AString databaseGUID;
84 
85  attribute nsIURI databaseLocation;
86 
87  attribute AString baseTable;
88 
89  attribute AString baseConstraintColumn;
90 
91  attribute unsigned long baseConstraintValue;
92 
93  attribute unsigned long fetchSize;
94 
95  attribute boolean isDistinct;
96 
97  readonly attribute boolean isValid;
98 
104  attribute boolean distinctWithSortableValues;
105 
106  readonly attribute unsigned long length;
107 
109 
111 
113 
114  void addSort(in AString aProperty,
115  in boolean aAscending);
116 
117  void clearSorts();
118 
119  readonly attribute sbIPropertyArray currentSort;
120 
121  void addFilter(in AString aProperty,
122  in nsIStringEnumerator aValues,
123  in boolean aIsSearch);
124 
125  void clearFilters();
126 
127  boolean isIndexCached(in unsigned long aIndex);
128 
135  AString getSortPropertyValueByIndex(in unsigned long aIndex);
136 
143  unsigned long getMediaItemIdByIndex(in unsigned long aIndex);
144 
151  AString getOrdinalByIndex(in unsigned long aIndex);
152 
159  AString getGuidByIndex(in unsigned long aIndex);
160 
167  unsigned long long getRowidByIndex(in unsigned long aIndex);
168 
175  AString getViewItemUIDByIndex(in unsigned long aIndex);
176 
182  void invalidate(in boolean aInvalidateLength);
183 
185 
186  void cloneInto(in sbILocalDatabaseGUIDArray aDest);
187 
188  void removeByIndex(in unsigned long aIndex);
189 
190  unsigned long getFirstIndexByPrefix(in AString aPrefix);
191 
192  unsigned long getFirstIndexByGuid(in AString aGuid);
193 
194  /* aViewItemUID is a concatenation of the mediaItem's rowid and mediaItemid
195  * in it's libraries database, of the form "rowid-mediaItemid".
196  *
197  * We can use this viewItemUID to find the index in the guid array
198  * of the mediaitem that it corresponds to. */
199  unsigned long getIndexByViewItemUID(in AString aViewItemUID);
200 
205  boolean containsGuid(in AString aGuid);
206 
211  void suppressInvalidation(in boolean aSuppress);
212 
220  void mayInvalidate([array, size_is(aCount)] in unsigned long aDirtyPropertyIDs,
221  in unsigned long aCount);
222 };
AString getOrdinalByIndex(in unsigned long aIndex)
Return the ordinal at the given index.
attribute boolean distinctWithSortableValues
If the guid array is distinct, this value will cause the guid array to be filled with the sortable va...
[USER CODE SHOULD NOT REFERENCE THIS CLASS]
void invalidate(in boolean aInvalidateLength)
Invalidate the contents of the array.
AString getSortPropertyValueByIndex(in unsigned long aIndex)
Return the sortable property value at the given index.
attribute sbILocalDatabaseGUIDArrayListener listener
boolean containsGuid(in AString aGuid)
Return true if the array contains the given GUID. May be forced to fetch and cache all items...
inArray array
attribute unsigned long baseConstraintValue
void removeByIndex(in unsigned long aIndex)
[USER CODE SHOULD NOT REFERENCE THIS CLASS]
void onAfterInvalidate()
Called right after underlying GUID array is invalidated.
[USER CODE SHOULD NOT REFERENCE THIS CLASS]
void removeCachedNonNullLength(in AString aKey)
unsigned long getCachedLength(in AString aKey)
void onBeforeInvalidate(in boolean aInvalidateLength)
Called before underlying GUID array is invalidated.
var uuid
attribute sbILocalDatabaseGUIDArrayLengthCache lengthCache
AString getGuidByIndex(in unsigned long aIndex)
Return the guid at the given index.
unsigned long long getRowidByIndex(in unsigned long aIndex)
Return the rowid at the given index.
unsigned long getFirstIndexByPrefix(in AString aPrefix)
readonly attribute sbIPropertyArray currentSort
attribute sbILocalDatabasePropertyCache propertyCache
void suppressInvalidation(in boolean aSuppress)
Counter based invalidation suppression.
unsigned long getFirstIndexByGuid(in AString aGuid)
void addSort(in AString aProperty, in boolean aAscending)
readonly attribute unsigned long length
sbILocalDatabaseGUIDArray clone()
void mayInvalidate([array, size_is(aCount)] in unsigned long aDirtyPropertyIDs, in unsigned long aCount)
Checks to see if the guid array needs to be invalidated and invalidates if needed.
void addCachedNonNullLength(in AString aKey, in unsigned long aLength)
unsigned long getMediaItemIdByIndex(in unsigned long aIndex)
Return the media item id at the given index.
AString getViewItemUIDByIndex(in unsigned long aIndex)
Return the viewItemUID for the item at the given index.
boolean isIndexCached(in unsigned long aIndex)
void removeCachedLength(in AString aKey)
[USER CODE SHOULD NOT REFERENCE THIS CLASS]
unsigned long getCachedNonNullLength(in AString aKey)
void addFilter(in AString aProperty, in nsIStringEnumerator aValues, in boolean aIsSearch)
readonly attribute boolean isValid
void cloneInto(in sbILocalDatabaseGUIDArray aDest)
restoreHistoryPrecursor aCount
void addCachedLength(in AString aKey, in unsigned long aLength)
An interface to carry around arrays of nsIProperty instances. Users of this interface should only QI ...
unsigned long getIndexByViewItemUID(in AString aViewItemUID)