forked from tidev/titanium-sdk
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #51 from jpl-mac/timob-8783
TIMOB-8783 BlackBerry: Implement Global APIs Part 1
- Loading branch information
Showing
8 changed files
with
295 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,5 @@ xcuserdata | |
*.LOCAL.* | ||
*.REMOTE.* | ||
*.o | ||
x86 | ||
arm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/** | ||
* Appcelerator Titanium Mobile | ||
* Copyright (c) 2009-2012 by Appcelerator, Inc. All Rights Reserved. | ||
* Licensed under the terms of the Apache Public License | ||
* Please see the LICENSE included with this distribution for details. | ||
*/ | ||
|
||
#include "TiJSONObject.h" | ||
|
||
#include "TiGenericFunctionObject.h" | ||
|
||
|
||
TiJSONObject::TiJSONObject(NativeObjectFactory* objectFactory) | ||
: TiObject("JSON") | ||
{ | ||
objectFactory_ = objectFactory; | ||
} | ||
|
||
TiJSONObject::~TiJSONObject() | ||
{ | ||
} | ||
|
||
void TiJSONObject::addObjectToParent(TiObject* parent, NativeObjectFactory* objectFactory) | ||
{ | ||
TiJSONObject* obj = new TiJSONObject(objectFactory); | ||
parent->addMember(obj); | ||
obj->release(); | ||
} | ||
|
||
void TiJSONObject::onCreateStaticMembers() | ||
{ | ||
TiGenericFunctionObject::addGenericFunctionToParent(this, "parse", this, _parse); | ||
TiGenericFunctionObject::addGenericFunctionToParent(this, "stringify", this, _stringify); | ||
} | ||
|
||
bool TiJSONObject::canAddMembers() const | ||
{ | ||
return false; | ||
} | ||
|
||
Handle<Value> TiJSONObject::_parse(void* userContext, TiObject* caller, const Arguments& args) | ||
{ | ||
// TODO: Implement | ||
return Undefined(); | ||
} | ||
|
||
Handle<Value> TiJSONObject::_stringify(void* userContext, TiObject* caller, const Arguments& args) | ||
{ | ||
// TODO: Implement | ||
return Undefined(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/** | ||
* Appcelerator Titanium Mobile | ||
* Copyright (c) 2009-2012 by Appcelerator, Inc. All Rights Reserved. | ||
* Licensed under the terms of the Apache Public License | ||
* Please see the LICENSE included with this distribution for details. | ||
*/ | ||
|
||
#ifndef TIJSONOBJECT_H_ | ||
#define TIJSONOBJECT_H_ | ||
|
||
#include "TiObject.h" | ||
|
||
|
||
/* | ||
* TiJSONObject | ||
* | ||
* JSON namespace | ||
*/ | ||
class TiJSONObject : public TiObject | ||
{ | ||
public: | ||
static void addObjectToParent(TiObject* parent, NativeObjectFactory* objectFactory); | ||
|
||
protected: | ||
virtual ~TiJSONObject(); | ||
virtual void onCreateStaticMembers(); | ||
virtual bool canAddMembers() const; | ||
|
||
private: | ||
explicit TiJSONObject(); | ||
explicit TiJSONObject(NativeObjectFactory* objectFactory); | ||
|
||
/* Not copiable; Not assignable */ | ||
TiJSONObject(const TiJSONObject&); | ||
TiJSONObject& operator=(const TiJSONObject&); | ||
|
||
static Handle<Value> _parse(void* userContext, TiObject* caller, const Arguments& args); | ||
static Handle<Value> _stringify(void* userContext, TiObject* caller, const Arguments& args); | ||
|
||
NativeObjectFactory* objectFactory_; | ||
}; | ||
|
||
#endif /* TIJSONOBJECT_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/** | ||
* Appcelerator Titanium Mobile | ||
* Copyright (c) 2009-2012 by Appcelerator, Inc. All Rights Reserved. | ||
* Licensed under the terms of the Apache Public License | ||
* Please see the LICENSE included with this distribution for details. | ||
*/ | ||
|
||
#include "TiStringObject.h" | ||
|
||
#include "TiGenericFunctionObject.h" | ||
|
||
|
||
TiStringObject::TiStringObject(NativeObjectFactory* objectFactory) | ||
: TiObject("String") | ||
{ | ||
objectFactory_ = objectFactory; | ||
} | ||
|
||
TiStringObject::~TiStringObject() | ||
{ | ||
} | ||
|
||
void TiStringObject::addObjectToParent(TiObject* parent, NativeObjectFactory* objectFactory) | ||
{ | ||
TiStringObject* obj = new TiStringObject(objectFactory); | ||
parent->addMember(obj); | ||
obj->release(); | ||
} | ||
|
||
void TiStringObject::onCreateStaticMembers() | ||
{ | ||
TiGenericFunctionObject::addGenericFunctionToParent(this, "format", this, _format); | ||
TiGenericFunctionObject::addGenericFunctionToParent(this, "formatCurrency", this, _formatCurrency); | ||
TiGenericFunctionObject::addGenericFunctionToParent(this, "formatDate", this, _formatDate); | ||
TiGenericFunctionObject::addGenericFunctionToParent(this, "formatDecimal", this, _formatDecimal); | ||
TiGenericFunctionObject::addGenericFunctionToParent(this, "formatTime", this, _formatTime); | ||
} | ||
|
||
bool TiStringObject::canAddMembers() const | ||
{ | ||
return false; | ||
} | ||
|
||
Handle<Value> TiStringObject::_format(void* userContext, TiObject* caller, const Arguments& args) | ||
{ | ||
// TODO: Implement | ||
return Undefined(); | ||
} | ||
|
||
Handle<Value> TiStringObject::_formatCurrency(void* userContext, TiObject* caller, const Arguments& args) | ||
{ | ||
// TODO: Implement | ||
return Undefined(); | ||
} | ||
|
||
Handle<Value> TiStringObject::_formatDate(void* userContext, TiObject* caller, const Arguments& args) | ||
{ | ||
// TODO: Implement | ||
return Undefined(); | ||
} | ||
|
||
Handle<Value> TiStringObject::_formatDecimal(void* userContext, TiObject* caller, const Arguments& args) | ||
{ | ||
// TODO: Implement | ||
return Undefined(); | ||
} | ||
|
||
Handle<Value> TiStringObject::_formatTime(void* userContext, TiObject* caller, const Arguments& args) | ||
{ | ||
// TODO: Implement | ||
return Undefined(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/** | ||
* Appcelerator Titanium Mobile | ||
* Copyright (c) 2009-2012 by Appcelerator, Inc. All Rights Reserved. | ||
* Licensed under the terms of the Apache Public License | ||
* Please see the LICENSE included with this distribution for details. | ||
*/ | ||
|
||
#ifndef TISTRINGOBJECT_H_ | ||
#define TISTRINGOBJECT_H_ | ||
|
||
#include "TiObject.h" | ||
|
||
|
||
/* | ||
* TiStringObject | ||
* | ||
* String namespace | ||
*/ | ||
class TiStringObject : public TiObject | ||
{ | ||
public: | ||
static void addObjectToParent(TiObject* parent, NativeObjectFactory* objectFactory); | ||
|
||
protected: | ||
virtual ~TiStringObject(); | ||
virtual void onCreateStaticMembers(); | ||
virtual bool canAddMembers() const; | ||
|
||
private: | ||
explicit TiStringObject(); | ||
explicit TiStringObject(NativeObjectFactory* objectFactory); | ||
|
||
/* Not copiable; Not assignable */ | ||
TiStringObject(const TiStringObject&); | ||
TiStringObject& operator=(const TiStringObject&); | ||
|
||
static Handle<Value> _format(void* userContext, TiObject* caller, const Arguments& args); | ||
static Handle<Value> _formatCurrency(void* userContext, TiObject* caller, const Arguments& args); | ||
static Handle<Value> _formatDate(void* userContext, TiObject* caller, const Arguments& args); | ||
static Handle<Value> _formatDecimal(void* userContext, TiObject* caller, const Arguments& args); | ||
static Handle<Value> _formatTime(void* userContext, TiObject* caller, const Arguments& args); | ||
|
||
NativeObjectFactory* objectFactory_; | ||
}; | ||
|
||
#endif /* TISTRINGOBJECT_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,6 @@ | |
|
||
#include "TiObject.h" | ||
|
||
class TiCascadesApp; | ||
|
||
/* | ||
* TiUIObject | ||
|