Purge underscored header file barriers
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / super-blur-view / super-blur-view-impl.h
index 846451a..9f229fb 100644 (file)
@@ -1,27 +1,28 @@
-#ifndef __DALI_TOOLKIT_INTERNAL_SUPER_BLUR_VIEW_H__
-#define __DALI_TOOLKIT_INTERNAL_SUPER_BLUR_VIEW_H__
-
-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Flora License, Version 1.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://floralicense.org/license/
-//
-// 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.
-//
+#ifndef DALI_TOOLKIT_INTERNAL_SUPER_BLUR_VIEW_H
+#define DALI_TOOLKIT_INTERNAL_SUPER_BLUR_VIEW_H
+
+/*
+ * Copyright (c) 2019 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.
+ *
+ */
 
 // INTERNAL INCLUDES
-#include <dali/dali.h>
 #include <dali-toolkit/public-api/controls/control-impl.h>
-#include <dali-toolkit/public-api/controls/super-blur-view/super-blur-view.h>
-#include <dali-toolkit/public-api/controls/gaussian-blur-view/gaussian-blur-view.h>
+#include <dali-toolkit/devel-api/controls/super-blur-view/super-blur-view.h>
+#include <dali-toolkit/devel-api/controls/gaussian-blur-view/gaussian-blur-view.h>
+#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
 
 namespace Dali
 {
@@ -37,8 +38,9 @@ namespace Internal
 /**
  * SuperBlurView implementation class
  */
-class SuperBlurView : public ControlImpl
+class SuperBlurView : public Control
 {
+
 public:
 
   /**
@@ -52,6 +54,12 @@ public:
   void SetImage(Image inputImage);
 
   /**
+   * Get the image for blurring.
+   * @return The image for blurring.
+   */
+  Image GetImage();
+
+  /**
    * @copydoc Dali::Toolkit::SuperBlurView::GetBlurStrengthPropertyIndex
    */
   Property::Index GetBlurStrengthPropertyIndex() const;
@@ -76,6 +84,24 @@ public:
    */
   Image GetBlurredImage( unsigned int level );
 
+  // Properties
+
+  /**
+   * Called when a property of an object of this type is set.
+   * @param[in] object The object whose property is set.
+   * @param[in] index The property index.
+   * @param[in] value The new property value.
+   */
+  static void SetProperty( BaseObject* object, Property::Index propertyIndex, const Property::Value& value );
+
+  /**
+   * Called to retrieve a property of an object of this type.
+   * @param[in] object The object whose property is to be retrieved.
+   * @param[in] index The property index.
+   * @return The current value of the property.
+   */
+  static Property::Value GetProperty( BaseObject* object, Property::Index propertyIndex );
+
 protected:
 
   /**
@@ -88,7 +114,7 @@ protected:
    */
   virtual ~SuperBlurView();
 
-private: // from ControlImpl
+private: // from Control
 
   /**
    * @copydoc Toolkit::Control::OnInitialize
@@ -96,14 +122,19 @@ private: // from ControlImpl
   virtual void OnInitialize();
 
   /**
-   * @copydoc Toolkit::Control::OnControlSizeSet
+   * @copydoc CustomActorImpl::OnSizeSet()
+   */
+  virtual void OnSizeSet(const Vector3& targetSize);
+
+  /**
+   * @copydoc CustomActorImpl::OnStageConnection()
    */
-  virtual void OnControlSizeSet(const Vector3& targetSize);
+  virtual void OnStageConnection( int depth );
 
   /**
-   * @copydoc Toolkit::ControlImpl::OnRelaidOut()
+   * @copydoc CustomActorImpl::GetNaturalSize()
    */
-  virtual void OnRelaidOut( Vector2 size, ActorSizeContainer& container );
+  virtual Vector3 GetNaturalSize();
 
 private:
 
@@ -125,22 +156,27 @@ private:
    */
   void ClearBlurResource();
 
-private:
-
-  unsigned int                           mBlurLevels;
-
-  Property::Index                        mBlurStrengthPropertyIndex;
+  /**
+   * Sets shader effect on the control renderer
+   * @param[in,out] Sets custom shader effect on the given visual
+   */
+  void SetShaderEffect( Toolkit::Visual::Base& visual );
 
+private:
   std::vector<Toolkit::GaussianBlurView> mGaussianBlurView;
   std::vector<FrameBufferImage>          mBlurredImage;
-  std::vector<ImageActor>                mImageActors;
-  bool                                   mResourcesCleared;
-
+  std::vector<Toolkit::Visual::Base>     mVisuals;
+  Image                                  mInputImage;
   Vector2                                mTargetSize;
+
   Toolkit::SuperBlurView::SuperBlurViewSignal mBlurFinishedSignal; ///< Signal emitted when blur has completed.
+
+  Property::Index                        mBlurStrengthPropertyIndex;
+  unsigned int                           mBlurLevels;
+  bool                                   mResourcesCleared;
 };
 
-}
+}  // namespace Internal
 
 // Helpers for public-api forwarding methods
 inline Toolkit::Internal::SuperBlurView& GetImpl( Toolkit::SuperBlurView& obj )
@@ -157,8 +193,8 @@ inline const Toolkit::Internal::SuperBlurView& GetImpl( const Toolkit::SuperBlur
   return static_cast<const Toolkit::Internal::SuperBlurView&>(handle);
 }
 
-}
+} // namespace Toolkit
 
-}
+} // namespace Dali
 
-#endif /* __DALI_TOOLKIT_INTERNALSUPER_BLUR_VIEW_H__ */
+#endif // DALI_TOOLKIT_INTERNAL_SUPER_BLUR_VIEW_H