2009-05-28 16:08:46 -04:00
|
|
|
/*
|
2010-03-12 14:35:25 -05:00
|
|
|
Yaaic - Yet Another Android IRC Client
|
2009-05-28 16:08:46 -04:00
|
|
|
|
2011-02-05 07:00:12 -05:00
|
|
|
Copyright 2009-2011 Sebastian Kaspari
|
2009-05-28 16:08:46 -04:00
|
|
|
|
|
|
|
This file is part of Yaaic.
|
|
|
|
|
|
|
|
Yaaic is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
Yaaic 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 Yaaic. If not, see <http://www.gnu.org/licenses/>.
|
2011-01-25 15:02:27 -05:00
|
|
|
*/
|
2009-12-17 15:27:57 -05:00
|
|
|
package org.yaaic.model;
|
2009-05-15 11:32:49 -04:00
|
|
|
|
2010-03-14 17:20:39 -04:00
|
|
|
import android.content.Intent;
|
|
|
|
|
2010-03-10 18:25:53 -05:00
|
|
|
/**
|
|
|
|
* Constants and helpers for Broadcasts
|
|
|
|
*
|
|
|
|
* @author Sebastian Kaspari <sebastian@yaaic.org>
|
|
|
|
*/
|
2010-03-14 17:13:23 -04:00
|
|
|
public abstract class Broadcast
|
2009-05-28 15:10:18 -04:00
|
|
|
{
|
2010-11-18 12:52:19 -05:00
|
|
|
public static final String SERVER_UPDATE = "org.yaaic.server.status";
|
2011-01-25 15:02:27 -05:00
|
|
|
|
2010-11-18 12:52:19 -05:00
|
|
|
public static final String CONVERSATION_MESSAGE = "org.yaaic.conversation.message";
|
|
|
|
public static final String CONVERSATION_NEW = "org.yaaic.conversation.new";
|
|
|
|
public static final String CONVERSATION_REMOVE = "org.yaaic.conversation.remove";
|
2011-01-25 15:02:27 -05:00
|
|
|
|
2010-11-18 12:52:19 -05:00
|
|
|
/**
|
|
|
|
* Create an Intent for conversation broadcasting
|
|
|
|
*
|
|
|
|
* @param broadcastType The type of the broadcast, some constant of Broadcast.*
|
|
|
|
* @param serverId The id of the server
|
|
|
|
* @param conversationName The unique name of the conversation
|
|
|
|
* @return The created Intent
|
|
|
|
*/
|
|
|
|
public static Intent createConversationIntent(String broadcastType, int serverId, String conversationName)
|
|
|
|
{
|
|
|
|
Intent intent = new Intent(broadcastType);
|
2011-01-25 15:02:27 -05:00
|
|
|
|
2010-11-18 12:52:19 -05:00
|
|
|
intent.putExtra(Extra.SERVER, serverId);
|
|
|
|
intent.putExtra(Extra.CONVERSATION, conversationName);
|
2011-01-25 15:02:27 -05:00
|
|
|
|
2010-11-18 12:52:19 -05:00
|
|
|
return intent;
|
|
|
|
}
|
2011-01-25 15:02:27 -05:00
|
|
|
|
2010-11-18 12:52:19 -05:00
|
|
|
/**
|
|
|
|
* Create an Intent for server broadcasting
|
|
|
|
*
|
|
|
|
* @param broadcastType The typo of the broadcast, some constant of Broadcast.*
|
|
|
|
* @param serverId The id of the server
|
|
|
|
* @return The created Intent
|
|
|
|
*/
|
|
|
|
public static Intent createServerIntent(String broadcastType, int serverId)
|
|
|
|
{
|
|
|
|
Intent intent = new Intent(broadcastType);
|
2011-01-25 15:02:27 -05:00
|
|
|
|
2010-11-18 12:52:19 -05:00
|
|
|
intent.putExtra(Extra.SERVER, serverId);
|
2011-01-25 15:02:27 -05:00
|
|
|
|
2010-11-18 12:52:19 -05:00
|
|
|
return intent;
|
|
|
|
}
|
2009-05-15 11:32:49 -04:00
|
|
|
}
|