Support legacy way to create InputMethodContext
[platform/core/uifw/dali-csharp-binder.git] / dali-csharp-binder / src / layout-controller.h
1 /*
2  * Copyright (c) 2019 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 // EXTERNAL INCLUDES
19 #include <dali/integration-api/processor-interface.h>
20
21 // INTERNAL INCLUDES
22 #include "common.h"
23
24 /**
25  * @brief Implements a Integration::Processor interface so can be registered with dali-core as
26  * a Processor.  Enables the setting of a callback so dali-core can execute this callback when
27  * Process() is run.
28  */
29 class LayoutController : public Dali::Integration::Processor
30 {
31 public:
32
33   // Function pointer matching delegate in C# LayoutController
34   using LayoutControllerProcessCallback = void (SWIGSTDCALL*)(int);
35
36 public:
37   /**
38    * @brief Constructor - creates a LayoutController and registers it with dali-core.
39    *
40    */
41   LayoutController();
42
43   /**
44    * @brief Destructor - Unregisters itself from dali-core.
45    */
46   ~LayoutController();
47
48   /**
49    * @brief Gets the id of the LayoutController that was initialised during construction.
50    * @return the id of the LayoutController.
51    * @note Useful for debugging when multiple LayoutControllers are registered with dali-core.
52    */
53   int GetId() const;
54
55   /**
56    * @copydoc Dali::Integration::Processor::Process()
57    */
58   void Process() override;
59
60    /**
61     * @brief Set the callback to be executed when dali-core calls the overriden Process() api.
62     * @param[in] callback, function to be called
63     */
64   void SetCallback( LayoutControllerProcessCallback callback );
65
66 private:
67
68   LayoutControllerProcessCallback handler;
69
70   int mId;
71
72 };