EmbedTouchManager.h 1.29 KB
Newer Older
Tatiana Meshkova's avatar
Tatiana Meshkova committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef EmbedTouchManager_H_
#define EmbedTouchManager_H_

#include "nsWeakReference.h"
#include "nsIObserver.h"
#include "nsIDOMEventListener.h"
#include "nsIEmbedAppService.h"
#include "EmbedTouchListener.h"
#include "nsCOMArray.h"

class EmbedTouchManager : public nsIObserver,
18
                          public nsSupportsWeakReference
Tatiana Meshkova's avatar
Tatiana Meshkova committed
19 20 21 22 23 24 25 26 27
{
public:
    EmbedTouchManager();

    NS_DECL_ISUPPORTS
    NS_DECL_NSIOBSERVER

    nsresult Init();
private:
28
    virtual ~EmbedTouchManager();
Tatiana Meshkova's avatar
Tatiana Meshkova committed
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
    void WindowCreated(nsIDOMWindow* aWin);
    void WindowDestroyed(nsIDOMWindow* aWin);
    nsCOMPtr<nsIEmbedAppService> mService;
    int mWindowCounter;
    typedef nsCOMArray<EmbedTouchListener> ObserversArray;
    ObserversArray mArray;
};

#define NS_EMBED_TOUCH_CONTRACTID "@mozilla.org/embed-touch-component;1"
#define NS_EMBED_TOUCH_SERVICE_CLASSNAME "Embed Touch Listener Component"
#define NS_EMBED_TOUCH_SERVICE_CID \
{ 0x73b10fd8, \
  0x6ea0, \
  0x11e2, \
  { 0xaa, 0x35, 0xaf, 0xbc, 0x0d, 0x69, 0x54 }}

#endif /*EmbedTouchManager_H_*/