#include "FUi_UiEventManager.h"
#include "FUi_TouchManager.h"
#include "FUi_DimmingManager.h"
+#include "FUi_IControlManagerEventListener.h"
#include "FUi_TouchLongPressGestureDetector.h"
#include "FUi_TouchTapGestureDetector.h"
#include "FUi_KeyEventManager.h"
#include "FUiCtrl_Frame.h"
#include "FUiCtrl_IndicatorManager.h"
+using namespace std;
using namespace Tizen::App;
using namespace Tizen::App::Package;
using namespace Tizen::Base;
result r = _SettingInfoImpl::RemoveSettingEventListenerForInternal(*__pInstance);
SysTryReturnVoidResult(NID_UI, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+ __pInstance->CallControlManagerEventListener();
+
delete __pInstance;
__pInstance = null;
}
, __defaultFontName(L"")
, __screenDpi(0)
, __pClipboardOwner(null)
+ , __pControlManagerEventListenerList(new (std::nothrow) LinkedListT<_IControlManagerEventListener*>)
{
result r = GetAppCoordinateSystem(__isCoordinateSystemLogical, __logicalCoordinateSystem, __logicalBaseScreenSize);
SysTryReturnVoidResult(NID_UI, r == E_SUCCESS, E_SYSTEM, "[E_SYSTEM] System error occurred.");
return r;
}
+void
+_ControlManager::CallControlManagerEventListener(void)
+{
+ unique_ptr<IEnumeratorT<_IControlManagerEventListener*> > pEnumerator(__pControlManagerEventListenerList->GetEnumeratorN());
+ if (pEnumerator)
+ {
+ while (pEnumerator->MoveNext() == E_SUCCESS)
+ {
+ _IControlManagerEventListener* pListener = null;
+ pEnumerator->GetCurrent(pListener);
+
+ if (pListener)
+ {
+ pListener->OnControlManagerTerminating();
+ }
+ }
+ }
+}
+
result
_ControlManager::CloseWindow(_Window& window) // [ToDo] exception check.
{
return GetCurrentFrame();
}
+result
+_ControlManager::AddControlManagerEventListener(_IControlManagerEventListener& listener)
+{
+ bool exist = __pControlManagerEventListenerList->Contains(&listener);
+ SysTryReturn(NID_UI, exist == false, E_OBJ_ALREADY_EXIST, E_OBJ_ALREADY_EXIST, "[%s] Propagating.", GetErrorMessage(E_OBJ_ALREADY_EXIST));
+
+ __pControlManagerEventListenerList->Add(&listener);
+
+ return E_SUCCESS;
+}
+
+result
+_ControlManager::RemoveControlManagerEventListener(_IControlManagerEventListener& listener)
+{
+ result r = __pControlManagerEventListenerList->Remove(&listener);
+ SysTryReturn(NID_UI, r == E_SUCCESS, E_OBJ_NOT_FOUND, E_OBJ_NOT_FOUND, "[%s] Propagating.", GetErrorMessage(E_OBJ_NOT_FOUND));
+
+ return E_SUCCESS;
+}
+
_Control*
_ControlManager::GetTopmostTouchedControl(const Point& point)
{
#ifndef _FUI_INTERNAL_CONTROL_MANAGER_H_
#define _FUI_INTERNAL_CONTROL_MANAGER_H_
+#include <unique_ptr.h>
#include <FBaseColIListT.h>
#include <FBaseColHashMapT.h>
#include <FGrp_CoordinateSystem.h>
class _IWindow;
class _IUiEventListener;
class _TouchGestureDetector;
+class _IControlManagerEventListener;
class _OSP_EXPORT_ _ControlManager
: public Tizen::System::ISettingEventListener
void SetClipboardOwner(_Window* pOwner);
_Window* GetClipboardOwner(void) const;
+ result AddControlManagerEventListener(_IControlManagerEventListener& listener);
+ result RemoveControlManagerEventListener(_IControlManagerEventListener& listener);
+
private:
~_ControlManager(void);
_ControlManager(void);
result CallOnPreAttachedToMainTree(_Control& control);
result CallOnAttachedToMainTree(_Control& control);
result CallOnDetachingFromMainTree(_Control& control);
+ void CallControlManagerEventListener(void);
virtual void OnSettingChanged(Tizen::Base::String& key);
static _ControlManager* __pInstance;
int __screenDpi;
_Window* __pClipboardOwner;
+ std::unique_ptr<Tizen::Base::Collection::IListT<_IControlManagerEventListener*> > __pControlManagerEventListenerList;
}; // _ControlManager
}} // Tizen::Ui
--- /dev/null
+//
+// Open Service Platform
+// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
+//
+// Licensed under the Apache License, Version 2.0 (the License);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+/**
+ * @file FUi_IControlManagerEventListener.h
+ * @brief This is the header file for the _IControlManagerEventListener class.
+ *
+ * This header file contains the declarations of the %_IControlManagerEventListener class.
+ */
+
+#ifndef _FUI_INTERNAL_ICONTROL_MANAGER_EVENT_LISTENER_H_
+#define _FUI_INTERNAL_ICONTROL_MANAGER_EVENT_LISTENER_H_
+
+#include <FBaseRtIEventListener.h>
+
+namespace Tizen { namespace Ui
+{
+
+class _OSP_EXPORT_ _IControlManagerEventListener
+ : public Tizen::Base::Runtime::IEventListener
+{
+public:
+ virtual ~_IControlManagerEventListener(void) {}
+ virtual void OnControlManagerTerminating(void) = 0;
+};
+
+}}//Tizen::Ui
+
+#endif // _FUI_INTERNAL_ICONTROL_MANAGER_EVENT_LISTENER_H_