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_
|
|
|
|
|
2013-05-03 02:53:54 +00:00
|
|
|
#include "base/compiler_specific.h"
|
2014-03-16 00:30:26 +00:00
|
|
|
#include "atom/browser/browser_observer.h"
|
|
|
|
#include "atom/common/api/atom_api_event_emitter.h"
|
2013-05-02 16:05:09 +00:00
|
|
|
|
|
|
|
namespace atom {
|
|
|
|
|
|
|
|
namespace api {
|
|
|
|
|
2013-05-03 02:53:54 +00:00
|
|
|
class App : public EventEmitter,
|
2013-05-03 11:31:24 +00:00
|
|
|
public BrowserObserver {
|
2013-05-02 16:05:09 +00:00
|
|
|
public:
|
2013-05-03 02:53:54 +00:00
|
|
|
virtual ~App();
|
|
|
|
|
2013-05-02 16:05:09 +00:00
|
|
|
static void Initialize(v8::Handle<v8::Object> target);
|
|
|
|
|
2013-05-03 02:53:54 +00:00
|
|
|
protected:
|
|
|
|
explicit App(v8::Handle<v8::Object> wrapper);
|
|
|
|
|
|
|
|
// BrowserObserver implementations:
|
|
|
|
virtual void OnWillQuit(bool* prevent_default) OVERRIDE;
|
|
|
|
virtual void OnWindowAllClosed() OVERRIDE;
|
2013-05-30 08:03:10 +00:00
|
|
|
virtual void OnOpenFile(bool* prevent_default,
|
|
|
|
const std::string& file_path) OVERRIDE;
|
2013-07-10 08:10:38 +00:00
|
|
|
virtual void OnOpenURL(const std::string& url) OVERRIDE;
|
2014-03-05 10:09:44 +00:00
|
|
|
virtual void OnActivateWithNoOpenWindows() OVERRIDE;
|
2013-06-03 07:31:46 +00:00
|
|
|
virtual void OnWillFinishLaunching() OVERRIDE;
|
2013-05-30 11:12:14 +00:00
|
|
|
virtual void OnFinishLaunching() OVERRIDE;
|
2013-05-03 02:53:54 +00:00
|
|
|
|
2013-05-02 16:05:09 +00:00
|
|
|
private:
|
2013-12-11 07:48:19 +00:00
|
|
|
static void New(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
|
|
|
|
|
|
static void Quit(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
|
|
static void Exit(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
|
|
static void Terminate(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
|
|
static void Focus(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
|
|
static void GetVersion(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
|
|
static void SetVersion(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
|
|
static void GetName(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
|
|
static void SetName(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
|
|
static void AppendSwitch(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
|
|
static void AppendArgument(const v8::FunctionCallbackInfo<v8::Value>& args);
|
2013-05-02 16:05:09 +00:00
|
|
|
|
2013-08-06 08:19:56 +00:00
|
|
|
#if defined(OS_MACOSX)
|
2013-12-11 07:48:19 +00:00
|
|
|
static void DockBounce(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
|
|
static void DockCancelBounce(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
|
|
static void DockSetBadgeText(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
|
|
static void DockGetBadgeText(const v8::FunctionCallbackInfo<v8::Value>& args);
|
2013-08-06 08:19:56 +00:00
|
|
|
#endif // defined(OS_MACOSX)
|
|
|
|
|
2013-05-03 02:53:54 +00:00
|
|
|
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_
|