// Path: app/src/main/java/jp/yokomark/lgtm/app/history/event/HistoryInvalidatedEvent.java
// public class HistoryInvalidatedEvent {}
// 
// Path: app/src/main/java/jp/yokomark/lgtm/app/history/event/HistoryLoadedEvent.java
// public class HistoryLoadedEvent {
//     private final Cursor mCursor;
// 
//     public HistoryLoadedEvent(Cursor cursor) {
//         mCursor = cursor;
//     }
// 
//     public Cursor getCursor() {
//         return mCursor;
//     }
// }
// 
// Path: app/src/main/java/jp/yokomark/lgtm/misc/event/EventBusUtils.java
// public final class EventBusUtils {
//     private EventBusUtils() {
//         throw new AssertionError();
//     }
// 
//     public static void postOnMainThread(final Bus bus, final Object event) {
//         HandlerUtils.postOnMain(new Runnable() {
//             @Override
//             public void run() {
//                 bus.post(event);
//             }
//         });
//     }
// 
//     public static void postOnMainThreadWithDelay(final Bus bus, final Object event, long delayInMillis) {
//         HandlerUtils.postOnMainWithDelay(new Runnable() {
//             @Override
//             public void run() {
//                 bus.post(event);
//             }
//         }, delayInMillis);
//     }
// }
// 
// Path: app/src/main/java/jp/yokomark/lgtm/misc/model/AbstractModel.java
// public abstract class AbstractModel {
//     private Context mContext;
// 
//     public AbstractModel(Context context) {
//         mContext = context;
//     }
// 
//     protected Context getContext() {
//         return mContext;
//     }
// 
//     protected LoaderManager getLoaderManager() {
//         return ((Activity) mContext).getLoaderManager();
//     }
// 
//     protected ContentResolver getContentResolver() {
//         return mContext.getContentResolver();
//     }
// }
// 
// Path: app/src/main/java/jp/yokomark/lgtm/utils/StorageUtils.java
// public final class StorageUtils {
//     public static final String TAG = StorageUtils.class.getSimpleName();
//     public static final String BUCKET_NAME = "LGTMCamera";
// 
//     private StorageUtils() {
//         throw new AssertionError();
//     }
// 
//     public static Uri saveImage(Context context, Bitmap bitmap, Bitmap.CompressFormat format, int quality) throws IOException {
//         File dir = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES), BUCKET_NAME);
//         if (!dir.exists()) {
//             if (!dir.mkdirs()) {
//                 throw new IOException("cannot create temporary dir on the external storage");
//             }
//         }
//         File dest = new File(dir, String.valueOf(System.currentTimeMillis()) + ".jpg");
//         Log.v(TAG, "saving as: " + dest.getAbsolutePath());
//         if (!saveAsFile(dest, bitmap, format, quality)) {
//             throw new IOException("failed to save bitmap as a file.");
//         }
//         String url = MediaStore.Images.Media.insertImage(context.getContentResolver(), dest.getAbsolutePath(), "", "");
//         Log.v(TAG, "stored at: " + url);
//         MediaScannerConnection.scanFile(context, new String[] {dest.getAbsolutePath()}, new String[] { "image/jpeg" }, null);
//         return Uri.parse(url);
//     }
// 
//     public static boolean saveAsFile(File file, Bitmap bitmap, Bitmap.CompressFormat format, int quality) throws IOException {
//         FileOutputStream stream = null;
//         try {
//             stream = new FileOutputStream(file);
//             if (!bitmap.compress(format, quality, stream)) {
//                 throw new IOException("failed to compress bitmap to the destination: " + file.toString());
//             }
//         } finally {
//             CloseableUtils.close(stream);
//         }
//         return true;
//     }
// }


import android.app.LoaderManager;
import android.content.Context;
import android.content.CursorLoader;
import android.content.Loader;
import android.database.Cursor;
import android.os.Bundle;
import android.provider.MediaStore;
import com.anprosit.android.dagger.annotation.ForActivity;
import com.anprosit.android.dagger.utils.ObjectGraphUtils;
import com.squareup.otto.Bus;
import javax.inject.Inject;
import jp.yokomark.lgtm.app.history.event.HistoryInvalidatedEvent;
import jp.yokomark.lgtm.app.history.event.HistoryLoadedEvent;
import jp.yokomark.lgtm.misc.event.EventBusUtils;
import jp.yokomark.lgtm.misc.model.AbstractModel;
import jp.yokomark.lgtm.utils.StorageUtils;
package jp.yokomark.lgtm.app.history.model;





/**
 * @author yokomakukeishin
 * @version 1.0.0
 * @since 1.0.0
 */
public class ComposeHistoryCollection extends AbstractModel implements LoaderManager.LoaderCallbacks<Cursor> {
    public static final String TAG = ComposeHistoryCollection.class.getSimpleName();
    private static final int LOADER_ID = 1;
    private static final String BUCKET_NAME = StorageUtils.BUCKET_NAME;
    @Inject Bus mBus;

    @Inject
// Path: app/src/main/java/jp/yokomark/lgtm/app/history/event/HistoryInvalidatedEvent.java
// public class HistoryInvalidatedEvent {}
// 
// Path: app/src/main/java/jp/yokomark/lgtm/app/history/event/HistoryLoadedEvent.java
// public class HistoryLoadedEvent {
//     private final Cursor mCursor;
// 
//     public HistoryLoadedEvent(Cursor cursor) {
//         mCursor = cursor;
//     }
// 
//     public Cursor getCursor() {
//         return mCursor;
//     }
// }
// 
// Path: app/src/main/java/jp/yokomark/lgtm/misc/event/EventBusUtils.java
// public final class EventBusUtils {
//     private EventBusUtils() {
//         throw new AssertionError();
//     }
// 
//     public static void postOnMainThread(final Bus bus, final Object event) {
//         HandlerUtils.postOnMain(new Runnable() {
//             @Override
//             public void run() {
//                 bus.post(event);
//             }
//         });
//     }
// 
//     public static void postOnMainThreadWithDelay(final Bus bus, final Object event, long delayInMillis) {
//         HandlerUtils.postOnMainWithDelay(new Runnable() {
//             @Override
//             public void run() {
//                 bus.post(event);
//             }
//         }, delayInMillis);
//     }
// }
// 
// Path: app/src/main/java/jp/yokomark/lgtm/misc/model/AbstractModel.java
// public abstract class AbstractModel {
//     private Context mContext;
// 
//     public AbstractModel(Context context) {
//         mContext = context;
//     }
// 
//     protected Context getContext() {
//         return mContext;
//     }
// 
//     protected LoaderManager getLoaderManager() {
//         return ((Activity) mContext).getLoaderManager();
//     }
// 
//     protected ContentResolver getContentResolver() {
//         return mContext.getContentResolver();
//     }
// }
// 
// Path: app/src/main/java/jp/yokomark/lgtm/utils/StorageUtils.java
// public final class StorageUtils {
//     public static final String TAG = StorageUtils.class.getSimpleName();
//     public static final String BUCKET_NAME = "LGTMCamera";
// 
//     private StorageUtils() {
//         throw new AssertionError();
//     }
// 
//     public static Uri saveImage(Context context, Bitmap bitmap, Bitmap.CompressFormat format, int quality) throws IOException {
//         File dir = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES), BUCKET_NAME);
//         if (!dir.exists()) {
//             if (!dir.mkdirs()) {
//                 throw new IOException("cannot create temporary dir on the external storage");
//             }
//         }
//         File dest = new File(dir, String.valueOf(System.currentTimeMillis()) + ".jpg");
//         Log.v(TAG, "saving as: " + dest.getAbsolutePath());
//         if (!saveAsFile(dest, bitmap, format, quality)) {
//             throw new IOException("failed to save bitmap as a file.");
//         }
//         String url = MediaStore.Images.Media.insertImage(context.getContentResolver(), dest.getAbsolutePath(), "", "");
//         Log.v(TAG, "stored at: " + url);
//         MediaScannerConnection.scanFile(context, new String[] {dest.getAbsolutePath()}, new String[] { "image/jpeg" }, null);
//         return Uri.parse(url);
//     }
// 
//     public static boolean saveAsFile(File file, Bitmap bitmap, Bitmap.CompressFormat format, int quality) throws IOException {
//         FileOutputStream stream = null;
//         try {
//             stream = new FileOutputStream(file);
//             if (!bitmap.compress(format, quality, stream)) {
//                 throw new IOException("failed to compress bitmap to the destination: " + file.toString());
//             }
//         } finally {
//             CloseableUtils.close(stream);
//         }
//         return true;
//     }
// }


// Path: app/src/main/java/jp/yokomark/lgtm/app/history/model/ComposeHistoryCollection.java
import android.app.LoaderManager;
import android.content.Context;
import android.content.CursorLoader;
import android.content.Loader;
import android.database.Cursor;
import android.os.Bundle;
import android.provider.MediaStore;
import com.anprosit.android.dagger.annotation.ForActivity;
import com.anprosit.android.dagger.utils.ObjectGraphUtils;
import com.squareup.otto.Bus;
import javax.inject.Inject;
import jp.yokomark.lgtm.app.history.event.HistoryInvalidatedEvent;
import jp.yokomark.lgtm.app.history.event.HistoryLoadedEvent;
import jp.yokomark.lgtm.misc.event.EventBusUtils;
import jp.yokomark.lgtm.misc.model.AbstractModel;
import jp.yokomark.lgtm.utils.StorageUtils;

package jp.yokomark.lgtm.app.history.model;





/**
 * @author yokomakukeishin
 * @version 1.0.0
 * @since 1.0.0
 */
public class ComposeHistoryCollection extends AbstractModel implements LoaderManager.LoaderCallbacks<Cursor> {
    public static final String TAG = ComposeHistoryCollection.class.getSimpleName();
    private static final int LOADER_ID = 1;
    private static final String BUCKET_NAME = StorageUtils.BUCKET_NAME;
    @Inject Bus mBus;

    @Inject
    public ComposeHistoryCollection(@ForActivity Context context) {