ResourceImage/Image split
[platform/core/uifw/dali-core.git] / dali / internal / event / images / nine-patch-image-impl.h
index ea757a1..3974075 100644 (file)
@@ -1,24 +1,26 @@
 #ifndef __DALI_INTERNAL_NINE_PATCH_IMAGE_H__
 #define __DALI_INTERNAL_NINE_PATCH_IMAGE_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.
-//
+/*
+ * Copyright (c) 2014 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/public-api/images/nine-patch-image.h>
+#include <dali/internal/event/images/resource-image-impl.h>
 #include <dali/internal/event/images/bitmap-image-impl.h>
 
 namespace Dali
@@ -43,7 +45,7 @@ class UpdateManager;
  * It's image data has a border which determines stretch and fill areas
  * Its pixel buffer data is loaded synchronously from file.
  */
-class NinePatchImage : public Image
+class NinePatchImage : public ResourceImage
 {
 public:
 
@@ -53,13 +55,11 @@ public:
    * Dali has ownership of the buffer.
    * @param [in] filename    File to load synchronously into buffer
    * @param [in] attributes  Image attributes of the file
-   * @param [in] loadPol     controls time of loading a resource from the filesystem (default: load when Image is created).
    * @param [in] releasePol  optionally relase memory when image is not visible on screen (default: keep image data until Image object is alive).
    */
   static NinePatchImagePtr New( const std::string& filename,
                                 const ImageAttributes& attributes,
-                                LoadPolicy    loadPol    = ImageLoadPolicyDefault,
-                                ReleasePolicy releasePol = ImageReleasePolicyDefault );
+                                ReleasePolicy releasePol = IMAGE_RELEASE_POLICY_DEFAULT );
 
   /**
    * Create a new NinePatchImage
@@ -67,13 +67,11 @@ public:
    * The maximum size of the image is limited by GL_MAX_TEXTURE_SIZE.
    * @param [in] filename    File to load synchronously into buffer
    * @param [in] attributes  Image attributes of the file
-   * @param [in] loadPol     controls time of loading a resource from the filesystem (default: load when Image is created).
    * @param [in] releasePol  optionally relase memory when image is not visible on screen (default: keep image data until Image object is alive).
    */
   NinePatchImage( const std::string& filename,
                   const ImageAttributes& attributes,
-                  LoadPolicy    loadPol    = ImageLoadPolicyDefault,
-                  ReleasePolicy releasePol = ImageReleasePolicyDefault );
+                  ReleasePolicy releasePol = IMAGE_RELEASE_POLICY_DEFAULT );
 
   /**
    * Convert Image object to a 9 patch image object if possible.
@@ -81,7 +79,7 @@ public:
    * @return A pointer to the 9 patch image object, or NULL
    * if the conversion is not possible.
    */
-  static NinePatchImage* GetNinePatchImage( Image* image);
+  static NinePatchImage* DownCast( Image* image);
 
 
 protected:
@@ -111,11 +109,6 @@ public:
    */
   BitmapImagePtr CreateCroppedBitmapImage();
 
-private:
-  /**
-   * Initializes internal data.
-   */
-  void Initialize();
 
 protected: // From Resource
   /**
@@ -138,7 +131,6 @@ private:
 private:
   ResourceClient*               mResourceClient;
   Integration::BitmapPtr        mBitmap;
-  SceneGraph::UpdateManager*    mUpdateManager;
   Vector4                       mStretchBorders;
   Rect<int>                     mChildRectangle;
   bool                          mParsedBorder;