sbPlaylistCommandsHelper.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 
30 #ifndef __SBPLAYLISTCOMMANDS_HELPER_H__
31 #define __SBPLAYLISTCOMMANDS_HELPER_H__
32 
33 #include "sbIPlaylistCommands.h"
34 #include "sbIPlaylistCommandsHelper.h"
35 
36 #include <nsIComponentManager.h>
37 #include <nsIGenericFactory.h>
38 
39 // DEFINES ====================================================================
40 #define SONGBIRD_PLAYLISTCOMMANDSHELPER_CONTRACTID \
41  "@songbirdnest.com/Songbird/PlaylistCommandsHelper;1"
42 #define SONGBIRD_PLAYLISTCOMMANDSHELPER_CLASSNAME \
43  "Songbird Playlist Commands Manager Simple Component"
44 #define SONGBIRD_PLAYLISTCOMMANDSHELPER_CID \
45 { \
46  0xada0a2ac, 0x1dd1, 0x11b2, \
47  {0xbb, 0x58, 0xce, 0xfe, 0xff, 0x88, 0x4e, 0xd4} \
48 }
49 // CLASSES ====================================================================
51 {
53 NS_DECL_SBIPLAYLISTCOMMANDSHELPER
54 public:
55 
57 
58  static NS_METHOD RegisterSelf(nsIComponentManager* aCompMgr,
59  nsIFile* aPath,
60  const char* aLoaderStr,
61  const char* aType,
62  const nsModuleComponentInfo *aInfo);
63 
64 private:
65  virtual ~sbPlaylistCommandsHelper();
66 
67  nsresult AddToServicePane(const nsAString &aMediaListGUID,
68  const nsAString &aMediaListType,
69  sbIPlaylistCommands *aCommandObject);
70 
71  nsresult AddToMediaItemContextMenu(const nsAString &aMediaListGUID,
72  const nsAString &aMediaListType,
73  sbIPlaylistCommands *aCommandObject);
74 
75  nsresult AddToToolbar(const nsAString &aMediaListGUID,
76  const nsAString &aMediaListType,
77  sbIPlaylistCommands *aCommandObject);
78 
79  nsresult AddCommandObject(PRUint16 aTargetFlags,
80  const nsAString &aMediaListGUID,
81  const nsAString &aMediaListType,
82  sbIPlaylistCommands *aCommandObject);
83 
84  nsresult SetRemainingFlags(PRUint16 aTargetFlags,
85  sbIPlaylistCommands *aCommandObject);
86 
87  nsresult RemoveCommandObject(PRUint16 aTargetFlags,
88  const nsAString &aMediaListGUID,
89  const nsAString &aMediaListType,
90  sbIPlaylistCommands *aCommandObject);
91 
92  nsresult GetCommandObject(PRUint16 aTargetFlag,
93  const nsAString &aMediaListGUID,
94  const nsAString &aMediaListType,
95  const nsAString &aCommandId,
96  sbIPlaylistCommands **_retval);
97 
98  nsresult GetChildCommandWithId(sbIPlaylistCommands *parentCommand,
99  const nsAString &aCommandId,
100  sbIPlaylistCommands **_retval);
101 
102 protected:
103  /* additional members */
104 };
105 #endif // __SBPLAYLISTCOMMANDS_HELPER_H__
_updateCookies aPath
static NS_METHOD RegisterSelf(nsIComponentManager *aCompMgr, nsIFile *aPath, const char *aLoaderStr, const char *aType, const nsModuleComponentInfo *aInfo)
A helper service to add and remove playlistCommands.
An interface that represents the set of command buttons and context menu items available on a display...