Skip to content

Commit

Permalink
TIMOB-12223
Browse files Browse the repository at this point in the history
Properties:
setData() - not working
setDisableBounce() - not working
setEnableZoomControls() - not working
setHideLoadIndicator()
setHtml()
setLoading() - not working
setPluginState() - not working
setScalesPageToFit()
setScrollsToTop() - not working
setShowScrollbars() - not working
setUrl()
setUserAgent()
setWillHandleTouches() - not working

Methods:
evalJS()

Events
beforeload
load
error - not working
  • Loading branch information
pec1985 committed Jan 27, 2013
1 parent 15d733c commit 1abe67a
Show file tree
Hide file tree
Showing 14 changed files with 842 additions and 4 deletions.
91 changes: 91 additions & 0 deletions src/tibb/NativeControlObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,12 @@ int NativeControlObject::setData(TiObject*)
return NATIVE_ERROR_NOTSUPPORTED;
}

PROP_SETGET(setDisableBounce)
int NativeControlObject::setDisableBounce(TiObject*)
{
return NATIVE_ERROR_NOTSUPPORTED;
}

PROP_SETGET(setEnabled)
int NativeControlObject::setEnabled(TiObject* obj)
{
Expand All @@ -505,6 +511,12 @@ int NativeControlObject::setEnabled(TiObject* obj)
return NATIVE_ERROR_OK;
}

PROP_SETGET(setEnableZoomControls)
int NativeControlObject::setEnableZoomControls(TiObject*)
{
return NATIVE_ERROR_NOTSUPPORTED;
}

PROP_SETGET(setFont)
int NativeControlObject::setFont(TiObject*)
{
Expand Down Expand Up @@ -566,12 +578,24 @@ int NativeControlObject::updateHeight()
return NATIVE_ERROR_OK;
}

PROP_SETGET(setHideLoadIndicator)
int NativeControlObject::setHideLoadIndicator(TiObject*)
{
return NATIVE_ERROR_NOTSUPPORTED;
}

PROP_SETGET(setHintText)
int NativeControlObject::setHintText(TiObject*)
{
return NATIVE_ERROR_NOTSUPPORTED;
}

PROP_SETGET(setHtml)
int NativeControlObject::setHtml(TiObject*)
{
return NATIVE_ERROR_NOTSUPPORTED;
}

PROP_SETGET(setImage)
int NativeControlObject::setImage(TiObject*)
{
Expand All @@ -584,6 +608,12 @@ int NativeControlObject::setLabel(TiObject*)
return NATIVE_ERROR_NOTSUPPORTED;
}

PROP_SETGET(setLoading)
int NativeControlObject::setLoading(TiObject*)
{
return NATIVE_ERROR_NOTSUPPORTED;
}

PROP_SETGET(setLeft)
int NativeControlObject::setLeft(TiObject* obj)
{
Expand Down Expand Up @@ -768,12 +798,36 @@ int NativeControlObject::setPasswordMask(TiObject*)
return NATIVE_ERROR_NOTSUPPORTED;
}

PROP_SETGET(setPluginState)
int NativeControlObject::setPluginState(TiObject*)
{
return NATIVE_ERROR_NOTSUPPORTED;
}

PROP_SETGET(setSelectedIndex)
int NativeControlObject::setSelectedIndex(TiObject*)
{
return NATIVE_ERROR_NOTSUPPORTED;
}

PROP_SETGET(setScalesPageToFit)
int NativeControlObject::setScalesPageToFit(TiObject*)
{
return NATIVE_ERROR_NOTSUPPORTED;
}

PROP_SETGET(setScrollsToTop)
int NativeControlObject::setScrollsToTop(TiObject*)
{
return NATIVE_ERROR_NOTSUPPORTED;
}

PROP_SETGET(setShowScrollbars)
int NativeControlObject::setShowScrollbars(TiObject*)
{
return NATIVE_ERROR_NOTSUPPORTED;
}

PROP_SETGET(setText)
int NativeControlObject::setText(TiObject*)
{
Expand All @@ -792,6 +846,18 @@ int NativeControlObject::setTitle(TiObject*)
return NATIVE_ERROR_NOTSUPPORTED;
}

PROP_SETGET(setUrl)
int NativeControlObject::setUrl(TiObject*)
{
return NATIVE_ERROR_NOTSUPPORTED;
}

PROP_SETGET(setUserAgent)
int NativeControlObject::setUserAgent(TiObject*)
{
return NATIVE_ERROR_NOTSUPPORTED;
}

PROP_SETGET(setTop)
int NativeControlObject::setTop(TiObject* obj)
{
Expand Down Expand Up @@ -850,6 +916,12 @@ int NativeControlObject::setVisible(TiObject* obj)
return setVisibility(visible);
}

PROP_SETGET(setWillHandleTouches)
int NativeControlObject::setWillHandleTouches(TiObject*)
{
return NATIVE_ERROR_NOTSUPPORTED;
}

PROP_SETGET(getRect)
int NativeControlObject::getRect(TiObject* obj)
{
Expand Down Expand Up @@ -1006,6 +1078,23 @@ int NativeControlObject::setMessage(TiObject*)

const static NATIVE_PROPSETGET_SETTING g_propSetGet[] =
{


//TODO: need to place alfabetically
{N_PROP_DISABLE_BOUNCE, PROP_SETGET_FUNCTION(setDisableBounce), NULL},
{N_PROP_ENABLE_ZOOM_CONTROLS, PROP_SETGET_FUNCTION(setEnableZoomControls), NULL},
{N_PROP_HIDE_LOAD_INDICATOR, PROP_SETGET_FUNCTION(setHideLoadIndicator), NULL},
{N_PROP_HTML, PROP_SETGET_FUNCTION(setHtml), NULL},
{N_PROP_LOADING, PROP_SETGET_FUNCTION(setLoading), NULL},
{N_PROP_PLUGIN_STATE, PROP_SETGET_FUNCTION(setPluginState), NULL},
{N_PROP_SCALES_TO_FIT, PROP_SETGET_FUNCTION(setScalesPageToFit), NULL},
{N_PROP_SCROLLS_TO_TOP, PROP_SETGET_FUNCTION(setScrollsToTop), NULL},
{N_PROP_SHOW_SCROLL_BARS, PROP_SETGET_FUNCTION(setShowScrollbars), NULL},
{N_PROP_USER_AGENT, PROP_SETGET_FUNCTION(setUserAgent), NULL},
{N_PROP_WILL_HANDLE_TOUCHES, PROP_SETGET_FUNCTION(setWillHandleTouches), NULL},



{N_PROP_ANCHOR_POINT, PROP_SETGET_FUNCTION(setAnchorPoint), NULL},
{N_PROP_BACKGROUND_IMAGE, PROP_SETGET_FUNCTION(setBackgroundImage), NULL},
{N_PROP_BACKGROUND_COLOR, PROP_SETGET_FUNCTION(setBackgroundColor), NULL},
Expand Down Expand Up @@ -1044,6 +1133,8 @@ const static NATIVE_PROPSETGET_SETTING g_propSetGet[] =
{N_PROP_VISIBLE, PROP_SETGET_FUNCTION(setVisible), NULL},
{N_PROP_WIDTH, PROP_SETGET_FUNCTION(setWidth), NULL},
{N_PROP_WINDOW, PROP_SETGET_FUNCTION(setWindow), NULL},
{N_PROP_WINDOW, PROP_SETGET_FUNCTION(setUrl), NULL},
{N_PROP_URL, PROP_SETGET_FUNCTION(setUrl), NULL},
{N_PROP_ZINDEX, PROP_SETGET_FUNCTION(setZIndex), PROP_SETGET_FUNCTION(getZIndex)}
};

Expand Down
17 changes: 14 additions & 3 deletions src/tibb/NativeControlObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,19 @@ class NativeControlObject : public NativeProxyObject
virtual int setCancel(TiObject* obj);
virtual int setColor(TiObject* obj);
virtual int setData(TiObject* obj);
virtual int setDisableBounce(TiObject* obj);
virtual int setEnabled(TiObject* obj);
virtual int setEnableZoomControls(TiObject* obj);
virtual int setFont(TiObject* obj);
virtual int setHeight(TiObject* obj);
virtual int setHideLoadIndicator(TiObject* obj);
virtual int setHintText(TiObject* obj);
virtual int setHtml(TiObject* obj);
virtual int setIcon(TiObject* obj);
virtual int setImage(TiObject* obj);
virtual int setLabel(TiObject* obj);
virtual int setLeft(TiObject* obj);
virtual int setLoading(TiObject* obj);
virtual int setMax(TiObject* obj);
virtual int setMaxDate(TiObject* obj);
virtual int setMessage(TiObject* obj);
Expand All @@ -101,22 +106,28 @@ class NativeControlObject : public NativeProxyObject
virtual int setOpacity(TiObject* obj);
virtual int setOptions(TiObject* obj);
virtual int setPasswordMask(TiObject* obj);
virtual int setPluginState(TiObject* obj);
virtual int setPropertyValue(size_t propertyNumber, TiObject* obj);
virtual int setRight(TiObject* obj);
virtual int setScalesPageToFit(TiObject* obj);
virtual int setScrollsToTop(TiObject* obj);
virtual int setShowScrollbars(TiObject* obj);
virtual int setSelectedIndex(TiObject* obj);
virtual int setText(TiObject* obj);
virtual int setTextAlign(TiObject* obj);
virtual int setTitle(TiObject* obj);
virtual int setType(TiObject* obj);
virtual int setTop(TiObject* obj);
virtual int setUrl(TiObject* obj);
virtual int setUserAgent(TiObject* obj);
virtual int setValue(TiObject* obj);
virtual int setVisibility(bool visible);
virtual int setVisible(TiObject* obj);
virtual int setWidth(TiObject* obj);
virtual int setWillHandleTouches(TiObject* obj);
virtual int setWindow(TiObject* obj);
virtual int startLayout();
virtual int setZIndex(TiObject* obj);

static int getColorComponents(TiObject* obj, float* r, float* g, float* b, float* a);
static int getBoolean(TiObject* obj, bool* value);
static int getString(TiObject* obj, QString& str);
Expand All @@ -127,6 +138,8 @@ class NativeControlObject : public NativeProxyObject
static int getPoint(TiObject* obj, float* x, float* y);
static int getDataModel(TiObject* obj, QVector<QVariant>& dataModel);
static int getDateTime(TiObject* obj, QDateTime& dt);
int updateHeight();
int updateWidth();
void updateLayout(QRectF rect);

protected:
Expand All @@ -147,8 +160,6 @@ class NativeControlObject : public NativeProxyObject
static int getMeasurementInfo(TiObject* obj, float maxPixels, float dotsPerMillimeter,
float* calculatedValue, bool* isAuto);
void updateViewLayout();
int updateHeight();
int updateWidth();
int updateLeft();
int updateTop();
int updateRight();
Expand Down
15 changes: 14 additions & 1 deletion src/tibb/NativeObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ enum NATIVE_TYPE
, N_TYPE_TEXT_FIELD
, N_TYPE_TOGGLEBUTTON
, N_TYPE_VIEW
, N_TYPE_WEBVIEW
, N_TYPE_WINDOW
};

Expand Down Expand Up @@ -83,7 +84,6 @@ enum NATIVE_PROP
, N_PROP_HEIGHT
, N_PROP_HIGHLIGHTED_COLOR
, N_PROP_HINT_TEXT
, N_PROP_HTML
, N_PROP_ICON
, N_PROP_IMAGE
, N_PROP_KEEP_SCREEN_ON
Expand Down Expand Up @@ -120,6 +120,19 @@ enum NATIVE_PROP
, N_PROP_WINDOW
, N_PROP_WORD_WRAP
, N_PROP_ZINDEX
, N_PROP_URL
//TODO: need to place alfabetically
, N_PROP_DISABLE_BOUNCE
, N_PROP_ENABLE_ZOOM_CONTROLS
, N_PROP_HIDE_LOAD_INDICATOR
, N_PROP_HTML
, N_PROP_LOADING
, N_PROP_PLUGIN_STATE
, N_PROP_SCALES_TO_FIT
, N_PROP_SCROLLS_TO_TOP
, N_PROP_SHOW_SCROLL_BARS
, N_PROP_USER_AGENT
, N_PROP_WILL_HANDLE_TOUCHES

/* This MUST be the last element */
, N_PROP_LAST
Expand Down
4 changes: 4 additions & 0 deletions src/tibb/NativeObjectFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "NativeToggleButtonObject.h"
#include "NativeWindowObject.h"
#include "NativeHTTPClientObject.h"
#include "NativeWebViewObject.h"
#include "TiCascadesApp.h"

#include <bb/cascades/Container>
Expand Down Expand Up @@ -142,6 +143,9 @@ NativeObject* NativeObjectFactory::createNativeObject(int type, TiObject* tiObj)
case N_TYPE_VIEW:
obj = NativeControlObject::createView(tiObj);
break;
case N_TYPE_WEBVIEW:
obj = NativeWebViewObject::createWebView(tiObj);
break;

}
if (obj != NULL)
Expand Down
1 change: 1 addition & 0 deletions src/tibb/NativeProxyObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

const char* NativeProxyObject::tetACCEPTED = "accepted";
const char* NativeProxyObject::tetCHANGE = "change";
const char* NativeProxyObject::tetBEFORELOAD = "beforeload";
const char* NativeProxyObject::tetCLICK = "click";
const char* NativeProxyObject::tetCONNECTED = "connected";
const char* NativeProxyObject::tetERROR = "error";
Expand Down
2 changes: 2 additions & 0 deletions src/tibb/NativeProxyObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ class NativeProxyObject: public NativeObject

// Ti event types (tet)
static const char* tetACCEPTED;
static const char* tetBEFORELOAD;
static const char* tetCHANGE;
static const char* tetCLICK;
static const char* tetCONNECTED;
Expand All @@ -97,6 +98,7 @@ class NativeProxyObject: public NativeObject
static const char* tetSTARTED;
static const char* tetDATA;


protected:
explicit NativeProxyObject(TiObject* tiObject);
virtual ~NativeProxyObject();
Expand Down

0 comments on commit 1abe67a

Please sign in to comment.