electron/browser/api/atom_api_app.h

61 lines
2 KiB
C
Raw Normal View History

2013-05-02 16:05:09 +00:00
// Copyright (c) 2013 GitHub, Inc. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ATOM_BROWSER_API_ATOM_API_APP_H_
#define ATOM_BROWSER_API_ATOM_API_APP_H_
#include "base/compiler_specific.h"
#include "browser/api/atom_api_event_emitter.h"
#include "browser/browser_observer.h"
2013-05-02 16:05:09 +00:00
namespace atom {
namespace api {
class App : public EventEmitter,
public BrowserObserver {
2013-05-02 16:05:09 +00:00
public:
virtual ~App();
2013-05-02 16:05:09 +00:00
static void Initialize(v8::Handle<v8::Object> target);
protected:
explicit App(v8::Handle<v8::Object> wrapper);
// BrowserObserver implementations:
virtual void OnWillQuit(bool* prevent_default) OVERRIDE;
virtual void OnWindowAllClosed() OVERRIDE;
virtual void OnOpenFile(bool* prevent_default,
const std::string& file_path) OVERRIDE;
virtual void OnOpenURL(const std::string& url) OVERRIDE;
virtual void OnWillFinishLaunching() OVERRIDE;
virtual void OnFinishLaunching() OVERRIDE;
2013-05-02 16:05:09 +00:00
private:
static v8::Handle<v8::Value> New(const v8::Arguments &args);
2013-05-02 16:05:09 +00:00
static v8::Handle<v8::Value> Quit(const v8::Arguments &args);
static v8::Handle<v8::Value> Exit(const v8::Arguments &args);
2013-05-02 16:05:09 +00:00
static v8::Handle<v8::Value> Terminate(const v8::Arguments &args);
2013-05-30 11:24:47 +00:00
static v8::Handle<v8::Value> Focus(const v8::Arguments &args);
2013-06-19 05:43:48 +00:00
static v8::Handle<v8::Value> GetVersion(const v8::Arguments &args);
static v8::Handle<v8::Value> AppendSwitch(const v8::Arguments &args);
static v8::Handle<v8::Value> AppendArgument(const v8::Arguments &args);
2013-05-02 16:05:09 +00:00
2013-08-06 08:19:56 +00:00
#if defined(OS_MACOSX)
static v8::Handle<v8::Value> DockBounce(const v8::Arguments& args);
static v8::Handle<v8::Value> DockCancelBounce(const v8::Arguments& args);
static v8::Handle<v8::Value> DockSetBadgeText(const v8::Arguments& args);
2013-08-06 08:39:31 +00:00
static v8::Handle<v8::Value> DockGetBadgeText(const v8::Arguments& args);
2013-08-06 08:19:56 +00:00
#endif // defined(OS_MACOSX)
DISALLOW_COPY_AND_ASSIGN(App);
2013-05-02 16:05:09 +00:00
};
} // namespace api
} // namespace atom
#endif // ATOM_BROWSER_API_ATOM_API_APP_H_