// Path: bst/src/main/java/ru/redsolution/dialogs/AcceptAndDeclineDialogListener.java
// public interface AcceptAndDeclineDialogListener extends AcceptDialogListener {
// 
// 	/**
// 	 * Request was declined. "No" button was pushed.
// 	 */
// 	void onDecline(DialogBuilder dialogBuilder);
// }
// 
// Path: bst/src/main/java/ru/redsolution/dialogs/DialogBuilder.java
// public class DialogBuilder extends AlertDialog.Builder implements
// 		DialogInterface.OnDismissListener {
// 	protected final Activity activity;
// 	protected final int dialogId;
// 
// 	/**
// 	 * Create builder.
// 	 * 
// 	 * @param activity
// 	 *            Parent activity.
// 	 * @param dialogId
// 	 *            Dialog ID to be removed.
// 	 */
// 	public DialogBuilder(Activity activity, int dialogId) {
// 		super(activity);
// 		this.activity = activity;
// 		this.dialogId = dialogId;
// 	}
// 
// 	@Override
// 	public AlertDialog create() {
// 		AlertDialog alertDialog = super.create();
// 		alertDialog.setOnDismissListener(this);
// 		return alertDialog;
// 	}
// 
// 	@Override
// 	public void onDismiss(DialogInterface dialog) {
// 		activity.removeDialog(dialogId);
// 	}
// 
// 	/**
// 	 * Returns dialog ID.
// 	 * 
// 	 * @return
// 	 */
// 	public int getDialogId() {
// 		return dialogId;
// 	}
// }


import ru.redsolution.dialogs.AcceptAndDeclineDialogListener;
import ru.redsolution.dialogs.DialogBuilder;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
/**
 * Copyright (c) 2013, Redsolution LTD. All rights reserved.
 *
 * This file is part of Barcode Scanner Terminal project;
 * you can redistribute it and/or modify it under the terms of
 *
 * Barcode Scanner Terminal is distributed in the hope that it will be
 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License,
 * along with this program. If not, see http://www.gnu.org/licenses/.
 */
package ru.redsolution.bst.ui.dialog;


/**
 * Обертка для добавления кнопки отмены к {@link DialogBuilder}.
 * 
 * @author alexander.ivanov
 * 
 * @param <T>
 */
public class CancelableDialogWrapper<T extends DialogBuilder> implements
		OnClickListener {

// Path: bst/src/main/java/ru/redsolution/dialogs/AcceptAndDeclineDialogListener.java
// public interface AcceptAndDeclineDialogListener extends AcceptDialogListener {
// 
// 	/**
// 	 * Request was declined. "No" button was pushed.
// 	 */
// 	void onDecline(DialogBuilder dialogBuilder);
// }
// 
// Path: bst/src/main/java/ru/redsolution/dialogs/DialogBuilder.java
// public class DialogBuilder extends AlertDialog.Builder implements
// 		DialogInterface.OnDismissListener {
// 	protected final Activity activity;
// 	protected final int dialogId;
// 
// 	/**
// 	 * Create builder.
// 	 * 
// 	 * @param activity
// 	 *            Parent activity.
// 	 * @param dialogId
// 	 *            Dialog ID to be removed.
// 	 */
// 	public DialogBuilder(Activity activity, int dialogId) {
// 		super(activity);
// 		this.activity = activity;
// 		this.dialogId = dialogId;
// 	}
// 
// 	@Override
// 	public AlertDialog create() {
// 		AlertDialog alertDialog = super.create();
// 		alertDialog.setOnDismissListener(this);
// 		return alertDialog;
// 	}
// 
// 	@Override
// 	public void onDismiss(DialogInterface dialog) {
// 		activity.removeDialog(dialogId);
// 	}
// 
// 	/**
// 	 * Returns dialog ID.
// 	 * 
// 	 * @return
// 	 */
// 	public int getDialogId() {
// 		return dialogId;
// 	}
// }


// Path: bst/src/main/java/ru/redsolution/bst/ui/dialog/CancelableDialogWrapper.java
import ru.redsolution.dialogs.AcceptAndDeclineDialogListener;
import ru.redsolution.dialogs.DialogBuilder;
import android.content.Context;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;

/**
 * Copyright (c) 2013, Redsolution LTD. All rights reserved.
 *
 * This file is part of Barcode Scanner Terminal project;
 * you can redistribute it and/or modify it under the terms of
 *
 * Barcode Scanner Terminal is distributed in the hope that it will be
 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License,
 * along with this program. If not, see http://www.gnu.org/licenses/.
 */
package ru.redsolution.bst.ui.dialog;


/**
 * Обертка для добавления кнопки отмены к {@link DialogBuilder}.
 * 
 * @author alexander.ivanov
 * 
 * @param <T>
 */
public class CancelableDialogWrapper<T extends DialogBuilder> implements
		OnClickListener {

	private final AcceptAndDeclineDialogListener listener;