code
stringlengths
1
2.01M
repo_name
stringlengths
3
62
path
stringlengths
1
267
language
stringclasses
231 values
license
stringclasses
13 values
size
int64
1
2.01M
package org.dodgybits.shuffle.android.list.view; import android.content.Context; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.View; import android.widget.Button; import android.widget.ImageButton; import android.widget.LinearLayout; import com.google.inject.Inject; import org.dodgybits.android.shuffle.R; import roboguice.event.EventManager; import roboguice.inject.InjectorProvider; public class ButtonBar extends LinearLayout implements View.OnClickListener { private Button mAddItemButton; private Button mOtherButton; private ImageButton mFilterButton; @Inject private EventManager mEventManager; public ButtonBar(Context context) { super(context); init(context); } public ButtonBar(Context context, AttributeSet attrs) { super(context, attrs); init(context); } private void init(Context context) { LayoutInflater vi = (LayoutInflater)context. getSystemService(android.content.Context.LAYOUT_INFLATER_SERVICE); vi.inflate(R.layout.button_bar, this, true); // wire up this component ((InjectorProvider)context).getInjector().injectMembers(this); mAddItemButton = (Button)findViewById(R.id.add_item_button); Drawable addIcon = getResources().getDrawable(android.R.drawable.ic_menu_add); addIcon.setBounds(0, 0, 24, 24); mAddItemButton.setCompoundDrawables(addIcon, null, null, null); mAddItemButton.setOnClickListener(this); mOtherButton = (Button)findViewById(R.id.other_button); mOtherButton.setOnClickListener(this); mFilterButton = (ImageButton)findViewById(R.id.filter_button); mFilterButton.setOnClickListener(this); } public Button getAddItemButton() { return mAddItemButton; } public Button getOtherButton() { return mOtherButton; } public ImageButton getFilterButton() { return mFilterButton; } public void onClick(View v) { switch (v.getId()) { case R.id.add_item_button: mEventManager.fire(getContext(), new AddItemButtonClickEvent()); break; case R.id.other_button: mEventManager.fire(getContext(), new OtherButtonClickEvent()); break; case R.id.filter_button: mEventManager.fire(getContext(), new FilterButtonClickEvent()); break; } } public class AddItemButtonClickEvent {}; public class OtherButtonClickEvent {}; public class FilterButtonClickEvent {}; }
115371172-shuffle
client/src/org/dodgybits/shuffle/android/list/view/ButtonBar.java
Java
asf20
2,685
/* * Copyright (C) 2009 Android Shuffle Open Source Project * * 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. */ package org.dodgybits.shuffle.android.list.view; import org.dodgybits.android.shuffle.R; import org.dodgybits.shuffle.android.core.model.Context; import org.dodgybits.shuffle.android.core.model.Project; import org.dodgybits.shuffle.android.core.model.Task; import org.dodgybits.shuffle.android.core.model.persistence.EntityCache; import org.dodgybits.shuffle.android.core.util.DateUtils; import org.dodgybits.shuffle.android.core.view.ContextIcon; import org.dodgybits.shuffle.android.core.view.DrawableUtils; import org.dodgybits.shuffle.android.preference.model.Preferences; import android.graphics.Color; import android.graphics.Typeface; import android.graphics.drawable.GradientDrawable; import android.graphics.drawable.GradientDrawable.Orientation; import android.text.SpannableString; import android.text.Spanned; import android.text.style.StrikethroughSpan; import android.view.LayoutInflater; import android.view.View; import android.widget.TextView; import com.google.inject.Inject; public class TaskView extends ItemView<Task> { private EntityCache<Context> mContextCache; private EntityCache<Project> mProjectCache; protected LabelView mContext; protected TextView mDescription; protected TextView mDateDisplay; protected TextView mProject; protected TextView mDetails; protected StatusView mStatus; protected boolean mShowContext; protected boolean mShowProject; @Inject public TaskView( android.content.Context androidContext, EntityCache<Context> contextCache, EntityCache<Project> projectCache) { super(androidContext); mContextCache = contextCache; mProjectCache = projectCache; LayoutInflater vi = (LayoutInflater)androidContext. getSystemService(android.content.Context.LAYOUT_INFLATER_SERVICE); vi.inflate(getViewResourceId(), this, true); mContext = (LabelView) findViewById(R.id.context); mDescription = (TextView) findViewById(R.id.description); mDateDisplay = (TextView) findViewById(R.id.due_date); mProject = (TextView) findViewById(R.id.project); mDetails = (TextView) findViewById(R.id.details); mStatus = (StatusView) findViewById(R.id.status); mShowContext = true; mShowProject = true; int bgColour = getResources().getColor(R.drawable.list_background); GradientDrawable drawable = DrawableUtils.createGradient(bgColour, Orientation.TOP_BOTTOM, 1.1f, 0.95f); setBackgroundDrawable(drawable); } protected int getViewResourceId() { return R.layout.list_task_view; } public void setShowContext(boolean showContext) { mShowContext = showContext; } public void setShowProject(boolean showProject) { mShowProject = showProject; } public void updateView(Task task) { Project project = mProjectCache.findById(task.getProjectId()); Context context = mContextCache.findById(task.getContextId()); updateContext(context); updateDescription(task); updateWhen(task); updateProject(project); updateDetails(task); updateStatus(task, context, project); } private void updateContext(Context context) { boolean displayContext = Preferences.displayContextName(getContext()); boolean displayIcon = Preferences.displayContextIcon(getContext()); if (mShowContext && context != null && (displayContext || displayIcon)) { mContext.setText(displayContext ? context.getName() : ""); mContext.setColourIndex(context.getColourIndex()); // add context icon if preferences indicate to ContextIcon icon = ContextIcon.createIcon(context.getIconName(), getResources()); int id = icon.smallIconId; if (id > 0 && displayIcon) { mContext.setIcon(getResources().getDrawable(id)); } else { mContext.setIcon(null); } mContext.setVisibility(View.VISIBLE); } else { mContext.setVisibility(View.GONE); } } private void updateDescription(Task task) { CharSequence description = task.getDescription(); if (task.isComplete()) { // add strike-through for completed tasks SpannableString desc = new SpannableString(description); desc.setSpan(new StrikethroughSpan(), 0, description.length(), Spanned.SPAN_PARAGRAPH); description = desc; } mDescription.setText(description); } private void updateWhen(Task task) { if (Preferences.displayDueDate(getContext())) { CharSequence dateRange = DateUtils.displayDateRange( getContext(), task.getStartDate(), task.getDueDate(), !task.isAllDay()); mDateDisplay.setText(dateRange); if (task.getDueDate() < System.currentTimeMillis()) { // task is overdue mDateDisplay.setTypeface(Typeface.DEFAULT_BOLD); mDateDisplay.setTextColor(Color.RED); } else { mDateDisplay.setTypeface(Typeface.DEFAULT); mDateDisplay.setTextColor( getContext().getResources().getColor(R.drawable.dark_blue)); } } else { mDateDisplay.setText(""); } } private void updateProject(Project project) { if (mShowProject && Preferences.displayProject(getContext()) && (project != null)) { mProject.setText(project.getName()); } else { mProject.setText(""); } } private void updateDetails(Task task) { final String details = task.getDetails(); if (Preferences.displayDetails(getContext()) && (details != null)) { mDetails.setText(details); } else { mDetails.setText(""); } } private void updateStatus(Task task, Context context, Project project) { mStatus.updateStatus(task, context, project, false); } }
115371172-shuffle
client/src/org/dodgybits/shuffle/android/list/view/TaskView.java
Java
asf20
6,816
/* * Copyright (C) 2009 Android Shuffle Open Source Project * * 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. */ package org.dodgybits.shuffle.android.list.view; import android.content.Context; import android.util.AttributeSet; import android.widget.LinearLayout; public abstract class ItemView<T> extends LinearLayout { public ItemView(Context context) { super(context); } public ItemView(Context context, AttributeSet attrs) { super(context, attrs); } public abstract void updateView(T item); }
115371172-shuffle
client/src/org/dodgybits/shuffle/android/list/view/ItemView.java
Java
asf20
1,028
/* * Copyright (C) 2009 Android Shuffle Open Source Project * * 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. */ package org.dodgybits.shuffle.android.list.view; import org.dodgybits.android.shuffle.R; import android.content.Context; public class ExpandableContextView extends ContextView { public ExpandableContextView(Context androidContext) { super(androidContext); } protected int getViewResourceId() { return R.layout.expandable_context_view; } }
115371172-shuffle
client/src/org/dodgybits/shuffle/android/list/view/ExpandableContextView.java
Java
asf20
979
/* * Copyright (C) 2009 Android Shuffle Open Source Project * * 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. */ package org.dodgybits.shuffle.android.list.view; import org.dodgybits.android.shuffle.R; import android.content.Context; public class ExpandableProjectView extends ProjectView { public ExpandableProjectView(Context androidContext) { super(androidContext); } protected int getViewResourceId() { return R.layout.expandable_project_view; } }
115371172-shuffle
client/src/org/dodgybits/shuffle/android/list/view/ExpandableProjectView.java
Java
asf20
979
/* * Copyright (C) 2009 Android Shuffle Open Source Project * * 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. */ package org.dodgybits.shuffle.android.list.view; public interface SwipeListItemListener { public void onListItemSwiped(int position); }
115371172-shuffle
client/src/org/dodgybits/shuffle/android/list/view/SwipeListItemListener.java
Java
asf20
764
/* * Copyright (C) 2009 Android Shuffle Open Source Project * * 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. */ package org.dodgybits.shuffle.android.list.config; import org.dodgybits.shuffle.android.core.model.Entity; import org.dodgybits.shuffle.android.core.model.persistence.TaskPersister; import android.content.ContextWrapper; public interface DrilldownListConfig<G extends Entity> extends ListConfig<G> { public String getChildName(ContextWrapper context); TaskPersister getChildPersister(); }
115371172-shuffle
client/src/org/dodgybits/shuffle/android/list/config/DrilldownListConfig.java
Java
asf20
1,029
package org.dodgybits.shuffle.android.list.config; import android.content.ContextWrapper; import com.google.inject.Inject; import org.dodgybits.android.shuffle.R; import org.dodgybits.shuffle.android.core.model.Context; import org.dodgybits.shuffle.android.core.model.Id; import org.dodgybits.shuffle.android.core.model.persistence.TaskPersister; import org.dodgybits.shuffle.android.core.model.persistence.selector.TaskSelector; import org.dodgybits.shuffle.android.list.annotation.ContextTasks; import org.dodgybits.shuffle.android.persistence.provider.TaskProvider; import org.dodgybits.shuffle.android.preference.model.ListPreferenceSettings; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import static org.dodgybits.shuffle.android.core.model.persistence.selector.Flag.no; public class ContextTasksListConfig extends AbstractTaskListConfig { private Id mContextId; private Context mContext; @Inject public ContextTasksListConfig(TaskPersister persister, @ContextTasks ListPreferenceSettings settings) { super(null, persister, settings); } @Override public int getCurrentViewMenuId() { return 0; } @Override public String createTitle(ContextWrapper context) { return context.getString(R.string.title_context_tasks, mContext.getName()); } @Override public boolean showTaskContext() { return false; } public void setContextId(Id contextId) { mContextId = contextId; setTaskSelector(createTaskQuery()); } public void setContext(Context context) { mContext = context; } private TaskSelector createTaskQuery() { List<Id> ids = Arrays.asList(new Id[]{mContextId}); TaskSelector query = TaskSelector.newBuilder() .setContexts(ids) .setSortOrder(TaskProvider.Tasks.CREATED_DATE + " ASC") .build(); return query; } }
115371172-shuffle
client/src/org/dodgybits/shuffle/android/list/config/ContextTasksListConfig.java
Java
asf20
1,955
package org.dodgybits.shuffle.android.list.config; import android.content.ContextWrapper; import com.google.inject.Inject; import org.dodgybits.android.shuffle.R; import org.dodgybits.shuffle.android.core.model.Context; import org.dodgybits.shuffle.android.core.model.Id; import org.dodgybits.shuffle.android.core.model.Project; import org.dodgybits.shuffle.android.core.model.persistence.TaskPersister; import org.dodgybits.shuffle.android.core.model.persistence.selector.Flag; import org.dodgybits.shuffle.android.core.model.persistence.selector.TaskSelector; import org.dodgybits.shuffle.android.list.annotation.ContextTasks; import org.dodgybits.shuffle.android.list.annotation.ProjectTasks; import org.dodgybits.shuffle.android.persistence.provider.TaskProvider; import org.dodgybits.shuffle.android.preference.model.ListPreferenceSettings; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import static org.dodgybits.shuffle.android.core.model.persistence.selector.Flag.no; public class ProjectTasksListConfig extends AbstractTaskListConfig { private Id mProjectId; private Project mProject; @Inject public ProjectTasksListConfig(TaskPersister persister, @ProjectTasks ListPreferenceSettings settings) { super(null, persister, settings); } @Override public int getCurrentViewMenuId() { return 0; } @Override public String createTitle(ContextWrapper context) { return context.getString(R.string.title_project_tasks, mProject.getName()); } @Override public boolean showTaskProject() { return false; } public void setProjectId(Id projectId) { mProjectId = projectId; setTaskSelector(createTaskQuery()); } public void setProject(Project project) { mProject = project; } private TaskSelector createTaskQuery() { List<Id> ids = Arrays.asList(new Id[]{mProjectId}); TaskSelector query = TaskSelector.newBuilder() .setProjects(ids) .setSortOrder(TaskProvider.Tasks.DISPLAY_ORDER + " ASC") .build(); return query; } }
115371172-shuffle
client/src/org/dodgybits/shuffle/android/list/config/ProjectTasksListConfig.java
Java
asf20
2,155
/* * Copyright (C) 2009 Android Shuffle Open Source Project * * 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. */ package org.dodgybits.shuffle.android.list.config; import org.dodgybits.shuffle.android.core.model.Entity; import org.dodgybits.shuffle.android.core.model.persistence.EntityPersister; import org.dodgybits.shuffle.android.core.model.persistence.TaskPersister; import android.content.ContextWrapper; import org.dodgybits.shuffle.android.core.model.persistence.selector.EntitySelector; import org.dodgybits.shuffle.android.core.model.persistence.selector.TaskSelector; import org.dodgybits.shuffle.android.preference.model.ListPreferenceSettings; public interface ExpandableListConfig<G extends Entity> { /** * @return id of layout for this view */ int getContentViewResId(); int getCurrentViewMenuId(); String getGroupName(ContextWrapper context); String getChildName(ContextWrapper context); /** * @return the name of the database column holding the key from the child to the parent */ String getGroupIdColumnName(); EntitySelector getGroupSelector(); TaskSelector getChildSelector(); EntityPersister<G> getGroupPersister(); TaskPersister getChildPersister(); ListPreferenceSettings getListPreferenceSettings(); }
115371172-shuffle
client/src/org/dodgybits/shuffle/android/list/config/ExpandableListConfig.java
Java
asf20
1,821
package org.dodgybits.shuffle.android.list.config; import static org.dodgybits.shuffle.android.core.model.persistence.selector.Flag.yes; import java.util.HashMap; import org.dodgybits.shuffle.android.core.model.persistence.selector.TaskSelector; import org.dodgybits.shuffle.android.core.model.persistence.selector.TaskSelector.PredefinedQuery; import org.dodgybits.shuffle.android.list.activity.task.InboxActivity; import org.dodgybits.shuffle.android.list.activity.task.TabbedDueActionsActivity; import org.dodgybits.shuffle.android.list.activity.task.TicklerActivity; import org.dodgybits.shuffle.android.list.activity.task.TopTasksActivity; import android.content.Context; import android.content.Intent; public class StandardTaskQueries { public static final String cInbox = "inbox"; public static final String cDueToday = "due_today"; public static final String cDueNextWeek = "due_next_week"; public static final String cDueNextMonth = "due_next_month"; public static final String cNextTasks = "next_tasks"; public static final String cTickler = "tickler"; public static final String cDueTasksFilterPrefs = "due_tasks"; public static final String cProjectFilterPrefs = "project"; public static final String cContextFilterPrefs = "context"; private static final TaskSelector cInboxQuery = TaskSelector.newBuilder().setPredefined(PredefinedQuery.inbox).build(); private static final TaskSelector cDueTodayQuery = TaskSelector.newBuilder().setPredefined(PredefinedQuery.dueToday).build(); private static final TaskSelector cDueNextWeekQuery = TaskSelector.newBuilder().setPredefined(PredefinedQuery.dueNextWeek).build(); private static final TaskSelector cDueNextMonthQuery = TaskSelector.newBuilder().setPredefined(PredefinedQuery.dueNextMonth).build(); private static final TaskSelector cNextTasksQuery = TaskSelector.newBuilder().setPredefined(PredefinedQuery.nextTasks).build(); private static final TaskSelector cTicklerQuery = TaskSelector.newBuilder().setPredefined(PredefinedQuery.tickler).build(); private static final HashMap<String,TaskSelector> cQueryMap = new HashMap<String,TaskSelector>(); static { cQueryMap.put(cInbox, cInboxQuery); cQueryMap.put(cDueToday, cDueTodayQuery); cQueryMap.put(cDueNextWeek, cDueNextWeekQuery); cQueryMap.put(cDueNextMonth, cDueNextMonthQuery); cQueryMap.put(cNextTasks, cNextTasksQuery); cQueryMap.put(cTickler, cTicklerQuery); } private static final HashMap<String,String> cFilterPrefsMap = new HashMap<String,String>(); static { cFilterPrefsMap.put(cInbox, cInbox); cFilterPrefsMap.put(cDueToday, cDueTasksFilterPrefs); cFilterPrefsMap.put(cDueNextWeek, cDueTasksFilterPrefs); cFilterPrefsMap.put(cDueNextMonth, cDueTasksFilterPrefs); cFilterPrefsMap.put(cNextTasks, cNextTasks); cFilterPrefsMap.put(cTickler, cTickler); } public static TaskSelector getQuery(String name) { return cQueryMap.get(name); } public static String getFilterPrefsKey(String name) { return cFilterPrefsMap.get(name); } public static Intent getActivityIntent(Context context, String name) { if (cInbox.equals(name)) { return new Intent(context, InboxActivity.class); } if (cNextTasks.equals(name)) { return new Intent(context, TopTasksActivity.class); } if (cTickler.equals(name)) { return new Intent(context, TicklerActivity.class); } PredefinedQuery query = PredefinedQuery.dueToday; if (cDueNextWeek.equals(name)) { query = PredefinedQuery.dueNextWeek; } else if (cDueNextMonth.equals(name)) { query = PredefinedQuery.dueNextMonth; } Intent intent = new Intent(context, TabbedDueActionsActivity.class); intent.putExtra(TabbedDueActionsActivity.DUE_MODE, query.name()); return intent; } }
115371172-shuffle
client/src/org/dodgybits/shuffle/android/list/config/StandardTaskQueries.java
Java
asf20
4,096
/* * Copyright (C) 2009 Android Shuffle Open Source Project * * 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. */ package org.dodgybits.shuffle.android.list.config; import org.dodgybits.shuffle.android.core.model.Entity; import org.dodgybits.shuffle.android.core.model.persistence.EntityPersister; import android.app.Activity; import android.content.ContextWrapper; import android.database.Cursor; import org.dodgybits.shuffle.android.core.model.persistence.selector.EntitySelector; import org.dodgybits.shuffle.android.preference.model.ListPreferenceSettings; public interface ListConfig<T extends Entity> { String createTitle(ContextWrapper context); String getItemName(ContextWrapper context); /** * @return id of layout for this view */ int getContentViewResId(); EntityPersister<T> getPersister(); EntitySelector getEntitySelector(); int getCurrentViewMenuId(); boolean supportsViewAction(); boolean isTaskList(); Cursor createQuery(Activity activity); ListPreferenceSettings getListPreferenceSettings(); }
115371172-shuffle
client/src/org/dodgybits/shuffle/android/list/config/ListConfig.java
Java
asf20
1,566
package org.dodgybits.shuffle.android.list.config; import android.content.ContextWrapper; import com.google.inject.Inject; import org.dodgybits.android.shuffle.R; import org.dodgybits.shuffle.android.core.model.persistence.TaskPersister; import org.dodgybits.shuffle.android.core.model.persistence.selector.Flag; import org.dodgybits.shuffle.android.core.model.persistence.selector.TaskSelector; import org.dodgybits.shuffle.android.core.view.MenuUtils; import org.dodgybits.shuffle.android.list.annotation.DueTasks; import org.dodgybits.shuffle.android.preference.model.ListPreferenceSettings; public class DueActionsListConfig extends AbstractTaskListConfig { private TaskSelector.PredefinedQuery mMode = TaskSelector.PredefinedQuery.dueToday; @Inject public DueActionsListConfig(TaskPersister persister, @DueTasks ListPreferenceSettings settings) { super( createSelector(TaskSelector.PredefinedQuery.dueToday), persister, settings); } public TaskSelector.PredefinedQuery getMode() { return mMode; } public void setMode(TaskSelector.PredefinedQuery mode) { mMode = mode; setTaskSelector(createSelector(mode)); } @Override public int getContentViewResId() { return R.layout.tabbed_due_tasks; } public int getCurrentViewMenuId() { return MenuUtils.CALENDAR_ID; } public String createTitle(ContextWrapper context) { return context.getString(R.string.title_calendar, getSelectedPeriod(context)); } private String getSelectedPeriod(ContextWrapper context) { String result = null; switch (mMode) { case dueToday: result = context.getString(R.string.day_button_title).toLowerCase(); break; case dueNextWeek: result = context.getString(R.string.week_button_title).toLowerCase(); break; case dueNextMonth: result = context.getString(R.string.month_button_title).toLowerCase(); break; } return result; } private static TaskSelector createSelector(TaskSelector.PredefinedQuery mMode) { return TaskSelector.newBuilder().setPredefined(mMode).build(); } }
115371172-shuffle
client/src/org/dodgybits/shuffle/android/list/config/DueActionsListConfig.java
Java
asf20
2,276
/* * Copyright (C) 2009 Android Shuffle Open Source Project * * 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. */ package org.dodgybits.shuffle.android.list.config; import org.dodgybits.android.shuffle.R; import org.dodgybits.shuffle.android.core.model.Context; import org.dodgybits.shuffle.android.core.model.persistence.ContextPersister; import org.dodgybits.shuffle.android.core.model.persistence.EntityPersister; import org.dodgybits.shuffle.android.core.model.persistence.TaskPersister; import org.dodgybits.shuffle.android.core.model.persistence.selector.ContextSelector; import org.dodgybits.shuffle.android.core.model.persistence.selector.EntitySelector; import org.dodgybits.shuffle.android.core.model.persistence.selector.TaskSelector; import org.dodgybits.shuffle.android.core.view.MenuUtils; import org.dodgybits.shuffle.android.list.annotation.ContextTasks; import org.dodgybits.shuffle.android.persistence.provider.ContextProvider; import android.app.Activity; import android.content.ContextWrapper; import android.database.Cursor; import com.google.inject.Inject; import org.dodgybits.shuffle.android.persistence.provider.TaskProvider; import org.dodgybits.shuffle.android.preference.model.ListPreferenceSettings; public class ContextListConfig implements DrilldownListConfig<Context> { private ContextPersister mGroupPersister; private TaskPersister mChildPersister; private ListPreferenceSettings mSettings; private EntitySelector mSelector; @Inject public ContextListConfig(ContextPersister contextPersister, TaskPersister taskPersister, @ContextTasks ListPreferenceSettings settings) { mGroupPersister = contextPersister; mChildPersister = taskPersister; mSettings = settings; mSelector = ContextSelector.newBuilder().setSortOrder(ContextProvider.Contexts.NAME + " ASC").build(); } @Override public String createTitle(ContextWrapper context) { return context.getString(R.string.title_context); } @Override public int getContentViewResId() { return R.layout.contexts; } @Override public int getCurrentViewMenuId() { return MenuUtils.CONTEXT_ID; } @Override public String getItemName(ContextWrapper context) { return context.getString(R.string.context_name); } @Override public boolean isTaskList() { return false; } @Override public EntityPersister<Context> getPersister() { return mGroupPersister; } @Override public TaskPersister getChildPersister() { return mChildPersister; } @Override public EntitySelector getEntitySelector() { return mSelector; } @Override public boolean supportsViewAction() { return false; } @Override public String getChildName(ContextWrapper context) { return context.getString(R.string.task_name); } @Override public Cursor createQuery(Activity activity) { EntitySelector selector = getEntitySelector().builderFrom(). applyListPreferences(activity, getListPreferenceSettings()).build(); return activity.managedQuery( getPersister().getContentUri(), ContextProvider.Contexts.FULL_PROJECTION, selector.getSelection(activity), selector.getSelectionArgs(), selector.getSortOrder()); } @Override public ListPreferenceSettings getListPreferenceSettings() { return mSettings; } }
115371172-shuffle
client/src/org/dodgybits/shuffle/android/list/config/ContextListConfig.java
Java
asf20
3,961
/* * Copyright (C) 2009 Android Shuffle Open Source Project * * 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. */ package org.dodgybits.shuffle.android.list.config; import org.dodgybits.android.shuffle.R; import org.dodgybits.shuffle.android.core.model.Task; import org.dodgybits.shuffle.android.core.model.persistence.EntityPersister; import org.dodgybits.shuffle.android.core.model.persistence.TaskPersister; import org.dodgybits.shuffle.android.core.model.persistence.selector.EntitySelector; import org.dodgybits.shuffle.android.core.model.persistence.selector.TaskSelector; import org.dodgybits.shuffle.android.persistence.provider.TaskProvider; import android.app.Activity; import android.content.ContextWrapper; import android.database.Cursor; import org.dodgybits.shuffle.android.preference.model.ListPreferenceSettings; public abstract class AbstractTaskListConfig implements TaskListConfig { private TaskPersister mPersister; private TaskSelector mTaskSelector; private ListPreferenceSettings mSettings; public AbstractTaskListConfig(TaskSelector selector, TaskPersister persister, ListPreferenceSettings settings) { mTaskSelector = selector; mPersister = persister; mSettings = settings; } @Override public int getContentViewResId() { return R.layout.task_list; } @Override public String getItemName(ContextWrapper context) { return context.getString(R.string.task_name); } @Override public EntityPersister<Task> getPersister() { return mPersister; } public TaskPersister getTaskPersister() { return mPersister; } @Override public boolean supportsViewAction() { return true; } @Override public boolean isTaskList() { return true; } @Override public TaskSelector getTaskSelector() { return mTaskSelector; } @Override public EntitySelector getEntitySelector() { return mTaskSelector; } @Override public void setTaskSelector(TaskSelector query) { mTaskSelector = query; } @Override public Cursor createQuery(Activity activity) { EntitySelector selector = getEntitySelector().builderFrom(). applyListPreferences(activity, getListPreferenceSettings()).build(); return activity.managedQuery( selector.getContentUri(), TaskProvider.Tasks.FULL_PROJECTION, selector.getSelection(activity), selector.getSelectionArgs(), selector.getSortOrder()); } @Override public ListPreferenceSettings getListPreferenceSettings() { return mSettings; } @Override public boolean showTaskContext() { return true; } @Override public boolean showTaskProject() { return true; } }
115371172-shuffle
client/src/org/dodgybits/shuffle/android/list/config/AbstractTaskListConfig.java
Java
asf20
3,373
/* * Copyright (C) 2009 Android Shuffle Open Source Project * * 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. */ package org.dodgybits.shuffle.android.list.config; import org.dodgybits.android.shuffle.R; import org.dodgybits.shuffle.android.core.model.Context; import org.dodgybits.shuffle.android.core.model.persistence.ContextPersister; import org.dodgybits.shuffle.android.core.model.persistence.EntityPersister; import org.dodgybits.shuffle.android.core.model.persistence.TaskPersister; import org.dodgybits.shuffle.android.core.model.persistence.selector.ContextSelector; import org.dodgybits.shuffle.android.core.model.persistence.selector.EntitySelector; import org.dodgybits.shuffle.android.core.model.persistence.selector.ProjectSelector; import org.dodgybits.shuffle.android.core.model.persistence.selector.TaskSelector; import org.dodgybits.shuffle.android.core.view.MenuUtils; import org.dodgybits.shuffle.android.list.annotation.ExpandableContexts; import org.dodgybits.shuffle.android.persistence.provider.TaskProvider; import android.content.ContextWrapper; import com.google.inject.Inject; import org.dodgybits.shuffle.android.preference.model.ListPreferenceSettings; public class ContextExpandableListConfig implements ExpandableListConfig<Context> { private ContextPersister mGroupPersister; private TaskPersister mChildPersister; private ListPreferenceSettings mSettings; private TaskSelector mTaskSelector; private ContextSelector mContextSelector; @Inject public ContextExpandableListConfig(ContextPersister contextPersister, TaskPersister taskPersister, @ExpandableContexts ListPreferenceSettings settings) { mGroupPersister = contextPersister; mChildPersister = taskPersister; mSettings = settings; mTaskSelector = TaskSelector.newBuilder().build(); mContextSelector = ContextSelector.newBuilder().build(); } @Override public EntitySelector getGroupSelector() { return mContextSelector; } @Override public TaskSelector getChildSelector() { return mTaskSelector; } @Override public String getChildName(ContextWrapper context) { return context.getString(R.string.task_name); } @Override public int getContentViewResId() { return R.layout.expandable_contexts; } @Override public int getCurrentViewMenuId() { return MenuUtils.CONTEXT_ID; } @Override public String getGroupIdColumnName() { return TaskProvider.Tasks.CONTEXT_ID; } @Override public String getGroupName(ContextWrapper context) { return context.getString(R.string.context_name); } @Override public TaskPersister getChildPersister() { return mChildPersister; } @Override public EntityPersister<Context> getGroupPersister() { return mGroupPersister; } @Override public ListPreferenceSettings getListPreferenceSettings() { return mSettings; } }
115371172-shuffle
client/src/org/dodgybits/shuffle/android/list/config/ContextExpandableListConfig.java
Java
asf20
3,542
package org.dodgybits.shuffle.android.list.config; import org.dodgybits.shuffle.android.core.model.Task; import org.dodgybits.shuffle.android.core.model.persistence.TaskPersister; import org.dodgybits.shuffle.android.core.model.persistence.selector.TaskSelector; import org.dodgybits.shuffle.android.preference.model.ListPreferenceSettings; public interface TaskListConfig extends ListConfig<Task> { TaskPersister getTaskPersister(); TaskSelector getTaskSelector(); void setTaskSelector(TaskSelector query); boolean showTaskContext(); boolean showTaskProject(); }
115371172-shuffle
client/src/org/dodgybits/shuffle/android/list/config/TaskListConfig.java
Java
asf20
595
/* * Copyright (C) 2009 Android Shuffle Open Source Project * * 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. */ package org.dodgybits.shuffle.android.list.config; import android.app.Activity; import android.content.ContextWrapper; import android.database.Cursor; import com.google.inject.Inject; import org.dodgybits.android.shuffle.R; import org.dodgybits.shuffle.android.core.model.Project; import org.dodgybits.shuffle.android.core.model.persistence.EntityPersister; import org.dodgybits.shuffle.android.core.model.persistence.ProjectPersister; import org.dodgybits.shuffle.android.core.model.persistence.TaskPersister; import org.dodgybits.shuffle.android.core.model.persistence.selector.EntitySelector; import org.dodgybits.shuffle.android.core.model.persistence.selector.ProjectSelector; import org.dodgybits.shuffle.android.core.view.MenuUtils; import org.dodgybits.shuffle.android.list.annotation.ProjectTasks; import org.dodgybits.shuffle.android.persistence.provider.ProjectProvider; import org.dodgybits.shuffle.android.preference.model.ListPreferenceSettings; public class ProjectListConfig implements DrilldownListConfig<Project> { private ProjectPersister mGroupPersister; private TaskPersister mChildPersister; private ListPreferenceSettings mSettings; private EntitySelector mSelector; @Inject public ProjectListConfig(ProjectPersister projectPersister, TaskPersister taskPersister, @ProjectTasks ListPreferenceSettings settings) { mGroupPersister = projectPersister; mChildPersister = taskPersister; mSettings = settings; mSelector = ProjectSelector.newBuilder().setSortOrder(ProjectProvider.Projects.NAME + " ASC").build(); } @Override public String getChildName(ContextWrapper context) { return context.getString(R.string.task_name); } @Override public String createTitle(ContextWrapper context) { return context.getString(R.string.title_project); } @Override public int getContentViewResId() { return R.layout.projects; } @Override public int getCurrentViewMenuId() { return MenuUtils.PROJECT_ID; } @Override public String getItemName(ContextWrapper context) { return context.getString(R.string.project_name); } @Override public boolean isTaskList() { return false; } @Override public boolean supportsViewAction() { return false; } @Override public EntityPersister<Project> getPersister() { return mGroupPersister; } @Override public TaskPersister getChildPersister() { return mChildPersister; } @Override public EntitySelector getEntitySelector() { return mSelector; } @Override public Cursor createQuery(Activity activity) { EntitySelector selector = getEntitySelector().builderFrom(). applyListPreferences(activity, getListPreferenceSettings()).build(); return activity.managedQuery( getPersister().getContentUri(), ProjectProvider.Projects.FULL_PROJECTION, selector.getSelection(activity), selector.getSelectionArgs(), selector.getSortOrder()); } @Override public ListPreferenceSettings getListPreferenceSettings() { return mSettings; } }
115371172-shuffle
client/src/org/dodgybits/shuffle/android/list/config/ProjectListConfig.java
Java
asf20
3,821
/* * Copyright (C) 2009 Android Shuffle Open Source Project * * 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. */ package org.dodgybits.shuffle.android.list.config; import android.content.ContextWrapper; import com.google.inject.Inject; import org.dodgybits.android.shuffle.R; import org.dodgybits.shuffle.android.core.model.Project; import org.dodgybits.shuffle.android.core.model.persistence.EntityPersister; import org.dodgybits.shuffle.android.core.model.persistence.ProjectPersister; import org.dodgybits.shuffle.android.core.model.persistence.TaskPersister; import org.dodgybits.shuffle.android.core.model.persistence.selector.EntitySelector; import org.dodgybits.shuffle.android.core.model.persistence.selector.ProjectSelector; import org.dodgybits.shuffle.android.core.model.persistence.selector.TaskSelector; import org.dodgybits.shuffle.android.core.view.MenuUtils; import org.dodgybits.shuffle.android.list.annotation.ExpandableProjects; import org.dodgybits.shuffle.android.persistence.provider.ProjectProvider; import org.dodgybits.shuffle.android.persistence.provider.TaskProvider; import org.dodgybits.shuffle.android.preference.model.ListPreferenceSettings; public class ProjectExpandableListConfig implements ExpandableListConfig<Project> { private ProjectPersister mGroupPersister; private TaskPersister mChildPersister; private ListPreferenceSettings mSettings; private TaskSelector mTaskSelector; private ProjectSelector mProjectSelector; @Inject public ProjectExpandableListConfig(ProjectPersister projectPersister, TaskPersister taskPersister, @ExpandableProjects ListPreferenceSettings settings) { mGroupPersister = projectPersister; mChildPersister = taskPersister; mSettings = settings; mTaskSelector = TaskSelector.newBuilder(). setSortOrder(TaskProvider.Tasks.DISPLAY_ORDER + " ASC").build(); mProjectSelector = ProjectSelector.newBuilder(). setSortOrder(ProjectProvider.Projects.NAME + " ASC").build(); } @Override public EntitySelector getGroupSelector() { return mProjectSelector; } @Override public TaskSelector getChildSelector() { return mTaskSelector; } @Override public String getChildName(ContextWrapper context) { return context.getString(R.string.task_name); } @Override public int getContentViewResId() { return R.layout.expandable_projects; } @Override public int getCurrentViewMenuId() { return MenuUtils.PROJECT_ID; } @Override public String getGroupIdColumnName() { return TaskProvider.Tasks.PROJECT_ID; } @Override public String getGroupName(ContextWrapper context) { return context.getString(R.string.project_name); } @Override public TaskPersister getChildPersister() { return mChildPersister; } @Override public EntityPersister<Project> getGroupPersister() { return mGroupPersister; } @Override public ListPreferenceSettings getListPreferenceSettings() { return mSettings; } }
115371172-shuffle
client/src/org/dodgybits/shuffle/android/list/config/ProjectExpandableListConfig.java
Java
asf20
3,679
{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff31507\deff0\stshfdbch31505\stshfloch31506\stshfhich31506\stshfbi31507\deflang1053\deflangfe1053\themelang1053\themelangfe0\themelangcs0{\fonttbl{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f0\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;} {\f37\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;}{\f39\fbidi \fnil\fcharset0\fprq0{\*\panose 00000000000000000000}HelveticaNeue;}{\flomajor\f31500\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;} {\fdbmajor\f31501\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fhimajor\f31502\fbidi \froman\fcharset0\fprq2{\*\panose 02040503050406030204}Cambria;} {\fbimajor\f31503\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\flominor\f31504\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;} {\fdbminor\f31505\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\fhiminor\f31506\fbidi \fswiss\fcharset0\fprq2{\*\panose 020f0502020204030204}Calibri;} {\fbiminor\f31507\fbidi \froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f293\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\f294\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} {\f296\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f297\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f298\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f299\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);} {\f300\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f301\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f293\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\f294\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} {\f296\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\f297\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\f298\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f299\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);} {\f300\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\f301\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f663\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\f664\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;} {\f666\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\f667\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\f670\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;}{\f671\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);} {\flomajor\f31508\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flomajor\f31509\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flomajor\f31511\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;} {\flomajor\f31512\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flomajor\f31513\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flomajor\f31514\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);} {\flomajor\f31515\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flomajor\f31516\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbmajor\f31518\fbidi \froman\fcharset238\fprq2 Times New Roman CE;} {\fdbmajor\f31519\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fdbmajor\f31521\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fdbmajor\f31522\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;} {\fdbmajor\f31523\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fdbmajor\f31524\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fdbmajor\f31525\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;} {\fdbmajor\f31526\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fhimajor\f31528\fbidi \froman\fcharset238\fprq2 Cambria CE;}{\fhimajor\f31529\fbidi \froman\fcharset204\fprq2 Cambria Cyr;} {\fhimajor\f31531\fbidi \froman\fcharset161\fprq2 Cambria Greek;}{\fhimajor\f31532\fbidi \froman\fcharset162\fprq2 Cambria Tur;}{\fhimajor\f31535\fbidi \froman\fcharset186\fprq2 Cambria Baltic;} {\fhimajor\f31536\fbidi \froman\fcharset163\fprq2 Cambria (Vietnamese);}{\fbimajor\f31538\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbimajor\f31539\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} {\fbimajor\f31541\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbimajor\f31542\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbimajor\f31543\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);} {\fbimajor\f31544\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbimajor\f31545\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbimajor\f31546\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);} {\flominor\f31548\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\flominor\f31549\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\flominor\f31551\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;} {\flominor\f31552\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\flominor\f31553\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\flominor\f31554\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);} {\flominor\f31555\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\flominor\f31556\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fdbminor\f31558\fbidi \froman\fcharset238\fprq2 Times New Roman CE;} {\fdbminor\f31559\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;}{\fdbminor\f31561\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fdbminor\f31562\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;} {\fdbminor\f31563\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\fdbminor\f31564\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fdbminor\f31565\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;} {\fdbminor\f31566\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\fhiminor\f31568\fbidi \fswiss\fcharset238\fprq2 Calibri CE;}{\fhiminor\f31569\fbidi \fswiss\fcharset204\fprq2 Calibri Cyr;} {\fhiminor\f31571\fbidi \fswiss\fcharset161\fprq2 Calibri Greek;}{\fhiminor\f31572\fbidi \fswiss\fcharset162\fprq2 Calibri Tur;}{\fhiminor\f31575\fbidi \fswiss\fcharset186\fprq2 Calibri Baltic;} {\fhiminor\f31576\fbidi \fswiss\fcharset163\fprq2 Calibri (Vietnamese);}{\fbiminor\f31578\fbidi \froman\fcharset238\fprq2 Times New Roman CE;}{\fbiminor\f31579\fbidi \froman\fcharset204\fprq2 Times New Roman Cyr;} {\fbiminor\f31581\fbidi \froman\fcharset161\fprq2 Times New Roman Greek;}{\fbiminor\f31582\fbidi \froman\fcharset162\fprq2 Times New Roman Tur;}{\fbiminor\f31583\fbidi \froman\fcharset177\fprq2 Times New Roman (Hebrew);} {\fbiminor\f31584\fbidi \froman\fcharset178\fprq2 Times New Roman (Arabic);}{\fbiminor\f31585\fbidi \froman\fcharset186\fprq2 Times New Roman Baltic;}{\fbiminor\f31586\fbidi \froman\fcharset163\fprq2 Times New Roman (Vietnamese);}} {\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0; \red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}{\*\defchp \fs22\loch\af31506\hich\af31506\dbch\af31505 }{\*\defpap \ql \li0\ri0\sa200\sl276\slmult1 \widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 }\noqfpromote {\stylesheet{\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 \fs22\lang1053\langfe1053\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1053\langfenp1053 \snext0 \sqformat \spriority0 Normal;}{\*\cs10 \additive \ssemihidden \sunhideused \spriority1 Default Paragraph Font;}{\* \ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\trcbpat1\trcfpat1\tblind0\tblindtype3\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv \ql \li0\ri0\sa200\sl276\slmult1 \widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 \fs22\lang1053\langfe1053\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1053\langfenp1053 \snext11 \ssemihidden \sunhideused Normal Table;}{\*\cs15 \additive \ul\cf2 \ssemihidden \sunhideused \styrsid8458154 Hyperlink;}}{\*\listtable{\list\listtemplateid685803640\listhybrid{\listlevel\levelnfc255\levelnfcn255\leveljc0\leveljcn0\levelfollow0\levelstartat0\levelspace0 \levelindent0{\leveltext\leveltemplateid-900038952\'00;}{\levelnumbers;}\rtlch\fcs1 \af0 \ltrch\fcs0 \jclisttab\tx360 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat0\levelspace0\levelindent0{\leveltext \leveltemplateid-1033628342\'00;}{\levelnumbers;}\rtlch\fcs1 \af0 \ltrch\fcs0 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat0\levelspace0\levelindent0{\leveltext\leveltemplateid826860412\'00;}{\levelnumbers;}\rtlch\fcs1 \af0 \ltrch\fcs0 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat0\levelspace0\levelindent0{\leveltext\leveltemplateid-1236385464\'00;}{\levelnumbers;}\rtlch\fcs1 \af0 \ltrch\fcs0 }{\listlevel\levelnfc0\levelnfcn0\leveljc0 \leveljcn0\levelfollow0\levelstartat0\levelspace0\levelindent0{\leveltext\leveltemplateid-342989116\'00;}{\levelnumbers;}\rtlch\fcs1 \af0 \ltrch\fcs0 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat0\levelspace0\levelindent0 {\leveltext\leveltemplateid-2200190\'00;}{\levelnumbers;}\rtlch\fcs1 \af0 \ltrch\fcs0 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat0\levelspace0\levelindent0{\leveltext\leveltemplateid1859789434\'00;}{\levelnumbers;} \rtlch\fcs1 \af0 \ltrch\fcs0 }{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat0\levelspace0\levelindent0{\leveltext\leveltemplateid486059564\'00;}{\levelnumbers;}\rtlch\fcs1 \af0 \ltrch\fcs0 }{\listlevel\levelnfc0\levelnfcn0 \leveljc0\leveljcn0\levelfollow0\levelstartat0\levelspace0\levelindent0{\leveltext\leveltemplateid989604422\'00;}{\levelnumbers;}\rtlch\fcs1 \af0 \ltrch\fcs0 }{\listname ;}\listid1}}{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}} {\*\rsidtbl \rsid8458154\rsid8602282\rsid9322363}{\mmathPr\mmathFont34\mbrkBin0\mbrkBinSub0\msmallFrac0\mdispDef1\mlMargin0\mrMargin0\mdefJc1\mwrapIndent1440\mintLim0\mnaryLim1}{\info{\operator Morten Nielsen}{\creatim\yr2010\mo8\dy8\hr16\min25} {\revtim\yr2010\mo8\dy8\hr16\min36}{\version2}{\edmins11}{\nofpages4}{\nofwords1071}{\nofchars5682}{\nofcharsws6740}{\vern49247}}{\*\xmlnstbl {\xmlns1 http://schemas.microsoft.com/office/word/2003/wordml}} \paperw11900\paperh16840\margl1440\margr1440\margt1417\margb1417\gutter0\ltrsect \widowctrl\ftnbj\aenddoc\hyphhotz425\trackmoves0\trackformatting1\donotembedsysfont0\relyonvml0\donotembedlingdata1\grfdocevents0\validatexml0\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors0\horzdoc\dghspace120\dgvspace120 \dghorigin1701\dgvorigin1984\dghshow0\dgvshow3\jcompress\viewkind1\viewscale100\rsidroot9322363 \fet0{\*\wgrffmtfilter 2450}\ilfomacatclnup0\ltrpar \sectd \ltrsect\linex0\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}} {\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}} {\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9 \pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}\pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\wrapdefault\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 \fs22\lang1053\langfe1053\loch\af31506\hich\af31506\dbch\af31505\cgrid\langnp1053\langfenp1053 {\rtlch\fcs1 \ab\af39\afs72 \ltrch\fcs0 \b\f39\fs72\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 Shuffle for Android}{\rtlch\fcs1 \ab\af39\afs24 \ltrch\fcs0 \b\f39\fs24\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 1.1}{\rtlch\fcs1 \ab\af39\afs72 \ltrch\fcs0 \b\f39\fs72\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \par }{\rtlch\fcs1 \ab\af39\afs24 \ltrch\fcs0 \b\f39\fs24\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 Designed and implemented by Andy Bryant \par }{\rtlch\fcs1 \ab\af39\afs38 \ltrch\fcs0 \b\f39\fs38\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \par }{\rtlch\fcs1 \ab\af39\afs48 \ltrch\fcs0 \b\f39\fs48\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 Quick Start Guide}{\rtlch\fcs1 \af39\afs48 \ltrch\fcs0 \f39\fs48\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \par }{\rtlch\fcs1 \af39\afs30 \ltrch\fcs0 \f39\fs30\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \par }{\rtlch\fcs1 \ab\af39\afs36 \ltrch\fcs0 \b\f39\fs36\cf9\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 Introduction}{\rtlch\fcs1 \af39\afs30 \ltrch\fcs0 \f39\fs30\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \par }{\rtlch\fcs1 \af39\afs28 \ltrch\fcs0 \f39\fs28\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 Thanks for trying out Sh\hich\af39\dbch\af31505\loch\f39 uffle, a personal organizational tool, styled around the "Getting Things Done" methodology. Shuffle is a dumping ground for ideas and tasks. It lets you rapidly create and organize your actions, relieving you of the stress of trying to remember everything \hich\af39\dbch\af31505\loch\f39 \hich\af39\dbch\af31505\loch\f39 you need to get done. Since Shuffle is a mobile application, you will have it with you where ever you are. You can always add an idea you've just had, or quickly check what's on the top of your list of actions. \par \par \hich\af39\dbch\af31505\loch\f39 A simple elegant workflow encourages you to \hich\af39\dbch\af31505\loch\f39 categorize your actions into projects and optionally provide a context. This structure lets you to break down formidable projects into individual achievable actions. As a project evolves over time, you can clean out old actions as they're performed, add \hich\af39\dbch\af31505\loch\f39 n\hich\af39\dbch\af31505\loch\f39 ew actions and reorder any remaining actions depending on your current priorities. \par \par \hich\af39\dbch\af31505\loch\f39 Shuffle provides five different perspectives, to support the GTD workflow. All perspective support creating, editing and deleting actions. }{\rtlch\fcs1 \af39\afs30 \ltrch\fcs0 \f39\fs30\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \par \par }{\rtlch\fcs1 \ab\af39\afs36 \ltrch\fcs0 \b\f39\fs36\cf9\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 Inbox}{\rtlch\fcs1 \af39\afs30 \ltrch\fcs0 \f39\fs30\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs28 \ltrch\fcs0 \f39\fs28\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 This is the best place t\hich\af39\dbch\af31505\loch\f39 o add your actions. The }{\rtlch\fcs1 \ab\ai\af39\afs28 \ltrch\fcs0 \b\i\f39\fs28\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 Inbox}{\rtlch\fcs1 \af39\afs28 \ltrch\fcs0 \f39\fs28\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 is where all actions start off before they are processed. It's a good idea to keep your Inbox as slim as possible. Doing so, does not mean you have to actually perform the actions. It simply means you've analyzed each action a \hich\af39\dbch\af31505\loch\f39 nd done one of the following: \par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs28 \ltrch\fcs0 \f39\fs28\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 - discard actions that no longer consider important \par \hich\af39\dbch\af31505\loch\f39 - perform the action if it doesn't require much time \par \hich\af39\dbch\af31505\loch\f39 - assigned the action to a project (and optionally a context) \par \hich\af39\dbch\af31505\loch\f39 - re-categorized the action as a project, if it requires ma\hich\af39\dbch\af31505\loch\f39 ny steps to complete \par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs28 \ltrch\fcs0 \f39\fs28\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 Once you've processed the list, select Clean up Inbox from the menu to clear out all the categorized actions from your Inbox. \par }{\rtlch\fcs1 \ab\af39\afs30 \ltrch\fcs0 \b\f39\fs30\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs36 \ltrch\fcs0 \b\f39\fs36\cf9\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 Projects}{\rtlch\fcs1 \ab\af39\afs30 \ltrch\fcs0 \b\f39\fs30\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs28 \ltrch\fcs0 \f39\fs28\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 Now that you've organized your actions, you can view them in a structured manner. The }{\rtlch\fcs1 \ab\ai\af39\afs28 \ltrch\fcs0 \b\i\f39\fs28\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 Project}{\rtlch\fcs1 \af39\afs28 \ltrch\fcs0 \f39\fs28\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 perspective lists all your projects, and allows you to drill-down into each project to view its actions. In addition to the standard adding, editing and deleting of actions, the project view also supports rearranging actions in the order you intend to co \hich\af39\dbch\af31505\loch\f39 m\hich\af39\dbch\af31505\loch\f39 plete them. This step is important for the Next Actions perspective discussed below. \par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs28 \ltrch\fcs0 \f39\fs28\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \par \hich\af39\dbch\af31505\loch\f39 Projects, like contexts, can be viewed in two different modes: drill-down or expandable view. \par \hich\af39\dbch\af31505\loch\f39 In drill down mode, clicking on a project takes you to another screen showi\hich\af39\dbch\af31505\loch\f39 ng the actions for that project. In expandable mode, clicking a project shows its actions on the same screen. Each view provides the same list of features, so choosing which to use (via the Preferences) is a matter of personal preference. \par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs28 \ltrch\fcs0 \f39\fs28\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \par \hich\af39\dbch\af31505\loch\f39 In addition to a\hich\af39\dbch\af31505\loch\f39 dding, editing and deleting actions (supported by all perspectives), the project view lets you rearrange your actions in the order you wish to complete them. \par }{\rtlch\fcs1 \af39\afs30 \ltrch\fcs0 \f39\fs30\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \par }{\rtlch\fcs1 \ab\af39\afs36 \ltrch\fcs0 \b\f39\fs36\cf9\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 Contexts}{\rtlch\fcs1 \af39\afs30 \ltrch\fcs0 \f39\fs30\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \par }{\rtlch\fcs1 \af39\afs28 \ltrch\fcs0 \f39\fs28\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 You may optionally assign a context to each of your actions. }{\rtlch\fcs1 \ab\ai\af39\afs28 \ltrch\fcs0 \b\i\f39\fs28\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 Contexts}{\rtlch\fcs1 \af39\afs28 \ltrch\fcs0 \f39\fs28\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 are situations in \hich\af39\dbch\af31505\loch\f39 which you intend to perform actions. Shuffle comes with a few standard contexts to get you started: }{\rtlch\fcs1 \ai\af39\afs28 \ltrch\fcs0 \i\f39\fs28\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 At home}{\rtlch\fcs1 \af39\afs28 \ltrch\fcs0 \f39\fs28\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 , }{\rtlch\fcs1 \ai\af39\afs28 \ltrch\fcs0 \i\f39\fs28\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 At work}{\rtlch\fcs1 \af39\afs28 \ltrch\fcs0 \f39\fs28\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 , }{\rtlch\fcs1 \ai\af39\afs28 \ltrch\fcs0 \i\f39\fs28\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 Online}{\rtlch\fcs1 \af39\afs28 \ltrch\fcs0 \f39\fs28\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 , }{\rtlch\fcs1 \ai\af39\afs28 \ltrch\fcs0 \i\f39\fs28\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 Errands}{\rtlch\fcs1 \af39\afs28 \ltrch\fcs0 \f39\fs28\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 , }{\rtlch\fcs1 \ai\af39\afs28 \ltrch\fcs0 \i\f39\fs28\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 Contact}{\rtlch\fcs1 \af39\afs28 \ltrch\fcs0 \f39\fs28\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 and }{\rtlch\fcs1 \ai\af39\afs28 \ltrch\fcs0 \i\f39\fs28\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 Read}{\rtlch\fcs1 \af39\afs28 \ltrch\fcs0 \f39\fs28\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 . Feel free to modify or delete the existing contexts, or add new ones that suit your situation. \par \par \hich\af39\dbch\af31505\loch\f39 The co\hich\af39\dbch\af31505\loch\f39 ntext view is especially useful when you're intending on getting something done, and need to see what actions are applicable to your current situation. For instance, you're out and about in town, so you check your }{\rtlch\fcs1 \ai\af39\afs28 \ltrch\fcs0 \i\f39\fs28\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 Errands}{\rtlch\fcs1 \af39\afs28 \ltrch\fcs0 \f39\fs28\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 context and see you need to buy an umbrella and pick up the dry cleaning on your way home. \par \par \hich\af39\dbch\af31505\loch\f39 Like the Projects perspective, contexts can be viewed in either drill-down or expandable mode, configurable via Settings. \par }{\rtlch\fcs1 \af39\afs30 \ltrch\fcs0 \f39\fs30\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \par }{\rtlch\fcs1 \ab\af39\afs36 \ltrch\fcs0 \b\f39\fs36\cf9\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 Next Actions \par }{\rtlch\fcs1 \ab\ai\af39\afs30 \ltrch\fcs0 \b\i\f39\fs30\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 Next actions}{\rtlch\fcs1 \af39\afs30 \ltrch\fcs0 \f39\fs30\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 is the best p\hich\af39\dbch\af31505\loch\f39 lace to look to determine what needs to be done. It shows the the top action for each of your projects. If you've organized each of your projects actions in the order you intend to complete them, this list quickly shows you the most important actions for \hich\af39\dbch\af31505\loch\f39 y\hich\af39\dbch\af31505\loch\f39 ou to get started on now. \par \par }{\rtlch\fcs1 \ab\af39\afs36 \ltrch\fcs0 \b\f39\fs36\cf9\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 Due Actions \par }{\rtlch\fcs1 \ab\ai\af39\afs30 \ltrch\fcs0 \b\i\f39\fs30\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 Due actions}{\rtlch\fcs1 \af39\afs30 \ltrch\fcs0 \f39\fs30\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 lets you keep track of actions you have assigned an explicit due date. There are 3 views - }{\rtlch\fcs1 \ai\af39\afs30 \ltrch\fcs0 \i\f39\fs30\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 Today}{\rtlch\fcs1 \af39\afs30 \ltrch\fcs0 \f39\fs30\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 , }{\rtlch\fcs1 \ai\af39\afs30 \ltrch\fcs0 \i\f39\fs30\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 This Week}{\rtlch\fcs1 \af39\afs30 \ltrch\fcs0 \f39\fs30\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 and }{\rtlch\fcs1 \ai\af39\afs30 \ltrch\fcs0 \i\f39\fs30\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 This Month}{\rtlch\fcs1 \af39\afs30 \ltrch\fcs0 \f39\fs30\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 each showing actions due for the given time scale. Overdue actions are shown in al\hich\af39\dbch\af31505\loch\f39 l views. \par \par }{\rtlch\fcs1 \ab\af39\afs36 \ltrch\fcs0 \b\f39\fs36\cf9\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 Settings \par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs30 \ltrch\fcs0 \f39\fs30\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 A number of aspects of Shuffle are user-configurable. The }{\rtlch\fcs1 \ab\ai\af39\afs30 \ltrch\fcs0 \b\i\f39\fs30\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 Settings}{\rtlch\fcs1 \af39\afs30 \ltrch\fcs0 \f39\fs30\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 screen is available from all Perspectives via the menu. \par }{\rtlch\fcs1 \ab\af39\afs30 \ltrch\fcs0 \b\f39\fs30\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 List layout}{\rtlch\fcs1 \af39\afs30 \ltrch\fcs0 \f39\fs30\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 - Show projects and contexts in two screens (drill-down) or in a tree structure (expandable). \par }{\rtlch\fcs1 \ab\af39\afs30 \ltrch\fcs0 \b\f39\fs30\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 Action appearance}{\rtlch\fcs1 \af39\afs30 \ltrch\fcs0 \f39\fs30\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 - Lets you custom what information to display for actions in each perspective. \par }{\rtlch\fcs1 \ab\af39\afs30 \ltrch\fcs0 \b\f39\fs30\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 Clean up}{\rtlch\fcs1 \af39\afs30 \ltrch\fcs0 \f39\fs30\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 - Delete completed actions or delete everything. \par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs38 \ltrch\fcs0 \b\f39\fs38\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \par }{\rtlch\fcs1 \ab\af39\afs36 \ltrch\fcs0 \b\f39\fs36\cf9\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 Tips \par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs30 \ltrch\fcs0 \f39\fs30\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 Some handy Shuffle features you may not know about: \par {\listtext\tab}}\pard \ltrpar\ql \fi-720\li720\ri0\nowidctlpar\tx220\jclisttab\tx360\tx720\wrapdefault\faauto\ls1\rin0\lin720\itap0 {\rtlch\fcs1 \af39\afs30 \ltrch\fcs0 \f39\fs30\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 In any list view, long press on an item\hich\af39\dbch\af31505\loch\f39 to see a menu of options. \par {\listtext\tab}\hich\af39\dbch\af31505\loch\f39 Hitting the Back button saves before closing. \par {\listtext\tab}\hich\af39\dbch\af31505\loch\f39 Use the }{\rtlch\fcs1 \ai\af39\afs30 \ltrch\fcs0 \i\f39\fs30\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 Save and New}{\rtlch\fcs1 \af39\afs30 \ltrch\fcs0 \f39\fs30\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 menu to create a bunch of actions in one go. \par {\listtext\tab}\hich\af39\dbch\af31505\loch\f39 You can mark an action as complete by swiping your finger over it in a list. \par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\tx220\tx720\wrapdefault\faauto\rin0\lin0\itap0\pararsid9322363 {\rtlch\fcs1 \af39\afs30 \ltrch\fcs0 \f39\fs30\lang1033\langfe1053\langnp1033\insrsid9322363 \par }{\rtlch\fcs1 \af39\afs36 \ltrch\fcs0 \b\f39\fs36\lang1033\langfe1053\langnp1033\insrsid9322363\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 Synchronizing with Tracks \par }{\rtlch\fcs1 \af39\afs30 \ltrch\fcs0 \f39\fs30\lang1033\langfe1053\langnp1033\insrsid9322363 \par \hich\af39\dbch\af31505\loch\f39 Settings \par \hich\af39\dbch\af31505\loch\f39 In the \hich\af39\dbch\af31505\loch\f39 settings m\hich\af39\dbch\af31505\loch\f39 enu there is an option \hich\af39\dbch\af31505\loch\f39 called \loch\af39\dbch\af31505\hich\f39 \'93\hich\af39\dbch\af31505\loch\f39 Track \hich\af39\dbch\af31505\loch\f39 s\hich\af39\dbch\af31505\loch\f39 settings\loch\af39\dbch\af31505\hich\f39 \'94\hich\af39\dbch\af31505\loch\f39 . Pressing the Tracks settings option allows you to enter the settings required to synchroniz \hich\af39\dbch\af31505\loch\f39 e with Tracks. \par \hich\af39\dbch\af31505\loch\f39 To synchronize with Tracks you need to enter the URL for the \hich\af39\dbch\af31505\loch\f39 Tracks installation, your username and password.\hich\af39\dbch\af31505\loch\f39 Currently there is no support for synchronizing with Tracks over HTTPs. \par \par \hich\af39\dbch\af31505\loch\f39 Once you have entered the settings you can check them with \hich\af39\dbch\af31505\loch\f39 the\hich\af39\dbch\af31505\loch\f39 check settings button. \par \par \hich\af39\dbch\af31505\loch\f39 You can set up the synchronization t\hich\af39\dbch\af31505\loch\f39 o run as a background process. This means that Shuffle with synchronize with Tracks at the given interval. \par \hich\af39\dbch\af31505\loch\f39 Once you have entered settings for synchronizing with Tracks, a Synchronize button appears in the menu at\hich\af39\dbch\af31505\loch\f39 the top-level menu in Shuffle, allowing you to synchronize manually. \par \par \hich\af39\dbch\af31505\loch\f39 Trouble-shooting \par \hich\af39\dbch\af31505\loch\f39 If you}{\rtlch\fcs1 \af39\afs30 \ltrch\fcs0 \f39\fs30\lang1033\langfe1053\langnp1033\insrsid8458154 \hich\af39\dbch\af31505\loch\f39 are}{\rtlch\fcs1 \af39\afs30 \ltrch\fcs0 \f39\fs30\lang1033\langfe1053\langnp1033\insrsid9322363 \hich\af39\dbch\af31505\loch\f39 hosting \hich\af39\dbch\af31505\loch\f39 your own Tracks and you cannot authenticate}{\rtlch\fcs1 \af39\afs30 \ltrch\fcs0 \f39\fs30\lang1033\langfe1053\langnp1033\insrsid8458154 \hich\af39\dbch\af31505\loch\f39 with your settings, but you c\hich\af39\dbch\af31505\loch\f39 an log in \hich\af39\dbch\af31505\loch\f39 to Tracks using them. Then double check if Apache is sending the au\hich\af39\dbch\af31505\loch\f39 thentication headers to Tracks. For more information see }{\field\fldedit{\*\fldinst {\rtlch\fcs1 \af31507 \ltrch\fcs0 \lang1033\langfe1053\langnp1033\insrsid8458154\charrsid8458154 \hich\af31506\dbch\af31505\loch\f31506 \hich\af31506\dbch\af31505\loch\f31506 HYPERLINK "http://www.getontracks.org/wiki/Known-Issues/"\hich\af31506\dbch\af31505\loch\f31506 }}{\fldrslt { \rtlch\fcs1 \af31507 \ltrch\fcs0 \cs15\ul\cf2\lang1033\langfe1053\langnp1033\insrsid8458154\charrsid8458154 \hich\af31506\dbch\af31505\loch\f31506 http://www.getontracks.org/wiki/Known-Issues/}}}\sectd \ltrsect\linex0\sectdefaultcl\sftnbj {\rtlch\fcs1 \af39\afs30 \ltrch\fcs0 \f39\fs30\lang1033\langfe1053\langnp1033\insrsid8458154 \par }{\rtlch\fcs1 \af39\afs30 \ltrch\fcs0 \f39\fs30\lang1033\langfe1053\langnp1033\insrsid9322363\charrsid9322363 \par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \ab\af39\afs38 \ltrch\fcs0 \b\f39\fs38\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \par }{\rtlch\fcs1 \ab\af39\afs36 \ltrch\fcs0 \b\f39\fs36\cf9\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 Project source}{\rtlch\fcs1 \af39\afs30 \ltrch\fcs0 \f39\fs30\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \par \hich\af39\dbch\af31505\loch\f39 Shuffle will be\hich\af39\dbch\af31505\loch\f39 released as open source under the Apache License 2.0 around 16th April 2008. The project is hosted at http://code.google.com/p/android-shuffle/ }{\rtlch\fcs1 \ab\af39\afs38 \ltrch\fcs0 \b\f39\fs38\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \par \par }{\rtlch\fcs1 \ab\af39\afs36 \ltrch\fcs0 \b\f39\fs36\cf9\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 Acknowledgements}{\rtlch\fcs1 \af39\afs30 \ltrch\fcs0 \f39\fs30\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \par }{\rtlch\fcs1 \af39\afs28 \ltrch\fcs0 \f39\fs28\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 Thanks to the team behind the }{\field{\*\fldinst {\rtlch\fcs1 \af39\afs28 \ltrch\fcs0 \f39\fs28\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 HYPERLINK "http://tango.freedesktop.org/Tango_Desktop_Project"}{\rtlch\fcs1 \af39\afs28 \ltrch\fcs0 \f39\fs28\insrsid9322363 {\*\datafield 00d0c9ea79f9bace118c8200aa004ba90b0200000003000000e0c9ea79f9bace118c8200aa004ba90b7e00000068007400740070003a002f002f00740061006e0067006f002e0066007200650065006400650073006b0074006f0070002e006f00720067002f00540061006e0067006f005f004400650073006b0074006f00 70005f00500072006f006a006500630074000000795881f43b1d7f48af2c825dc485276300000000a5ab0000}}}{\fldrslt {\rtlch\fcs1 \af39\afs28 \ltrch\fcs0 \f39\fs28\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 Tango Desktop Project}}}\sectd \ltrsect\linex0\sectdefaultcl\sftnbj {\rtlch\fcs1 \af39\afs28 \ltrch\fcs0 \f39\fs28\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 , an open source collection of icons used in Shuffle. \par \hich\af39\dbch\af31505\loch\f39 Thanks also to David Gibb for providing some great feedback on the design and to Gudrun for tolerating my nights and weekends spent tinkering with Android. \par \par }\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\faauto\rin0\lin0\itap0 {\rtlch\fcs1 \af39\afs28 \ltrch\fcs0 \f39\fs28\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 For feedback or bug reports, please check }{\field{\*\fldinst {\rtlch\fcs1 \af39\afs28 \ltrch\fcs0 \f39\fs28\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 HYPERLINK "http://code.google.com/p/android-shuffle/issues/list"}{\rtlch\fcs1 \af39\afs28 \ltrch\fcs0 \f39\fs28\insrsid9322363 {\*\datafield 00d0c9ea79f9bace118c8200aa004ba90b0200000003000000e0c9ea79f9bace118c8200aa004ba90b8200000068007400740070003a002f002f0063006f00640065002e0067006f006f0067006c0065002e0063006f006d002f0070002f0061006e00640072006f00690064002d00730068007500660066006c0065002f00 6900730073007500650073002f006c006900730074000000795881f43b1d7f48af2c825dc485276300000000a5ab0000}}}{\fldrslt {\rtlch\fcs1 \af39\afs28 \ltrch\fcs0 \f39\fs28\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 Shuffle issues list}}}\sectd \ltrsect\linex0\sectdefaultcl\sftnbj {\rtlch\fcs1 \af39\afs28 \ltrch\fcs0 \f39\fs28\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 or }{\field{\*\fldinst {\rtlch\fcs1 \af39\afs28 \ltrch\fcs0 \f39\fs28\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 HYPERLINK "mailto:andy@dodgybits.org"}{\rtlch\fcs1 \af39\afs28 \ltrch\fcs0 \f39\fs28\insrsid9322363 {\*\datafield 00d0c9ea79f9bace118c8200aa004ba90b0200000003000000e0c9ea79f9bace118c8200aa004ba90b4c0000006d00610069006c0074006f003a0061006e0064007900400064006f0064006700790062006900740073002e006f00720067000000795881f43b1d7f48af2c825dc485276300000000a5ab0000}}}{\fldrslt {\rtlch\fcs1 \af39\afs28 \ltrch\fcs0 \f39\fs28\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \hich\af39\dbch\af31505\loch\f39 email me}}}\sectd \ltrsect\linex0\sectdefaultcl\sftnbj {\rtlch\fcs1 \af39\afs28 \ltrch\fcs0 \f39\fs28\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 .}{\rtlch\fcs1 \af39\afs28 \ltrch\fcs0 \f39\fs28\lang1033\langfe1053\langnp1033\insrsid8602282\charrsid9322363 \par }{\*\themedata 504b030414000600080000002100e9de0fbfff0000001c020000130000005b436f6e74656e745f54797065735d2e786d6cac91cb4ec3301045f748fc83e52d4a 9cb2400825e982c78ec7a27cc0c8992416c9d8b2a755fbf74cd25442a820166c2cd933f79e3be372bd1f07b5c3989ca74aaff2422b24eb1b475da5df374fd9ad 5689811a183c61a50f98f4babebc2837878049899a52a57be670674cb23d8e90721f90a4d2fa3802cb35762680fd800ecd7551dc18eb899138e3c943d7e503b6 b01d583deee5f99824e290b4ba3f364eac4a430883b3c092d4eca8f946c916422ecab927f52ea42b89a1cd59c254f919b0e85e6535d135a8de20f20b8c12c3b0 0c895fcf6720192de6bf3b9e89ecdbd6596cbcdd8eb28e7c365ecc4ec1ff1460f53fe813d3cc7f5b7f020000ffff0300504b030414000600080000002100a5d6 a7e7c0000000360100000b0000005f72656c732f2e72656c73848fcf6ac3300c87ef85bd83d17d51d2c31825762fa590432fa37d00e1287f68221bdb1bebdb4f c7060abb0884a4eff7a93dfeae8bf9e194e720169aaa06c3e2433fcb68e1763dbf7f82c985a4a725085b787086a37bdbb55fbc50d1a33ccd311ba548b6309512 0f88d94fbc52ae4264d1c910d24a45db3462247fa791715fd71f989e19e0364cd3f51652d73760ae8fa8c9ffb3c330cc9e4fc17faf2ce545046e37944c69e462 a1a82fe353bd90a865aad41ed0b5b8f9d6fd010000ffff0300504b0304140006000800000021006b799616830000008a0000001c0000007468656d652f746865 6d652f7468656d654d616e616765722e786d6c0ccc4d0ac3201040e17da17790d93763bb284562b2cbaebbf600439c1a41c7a0d29fdbd7e5e38337cedf14d59b 4b0d592c9c070d8a65cd2e88b7f07c2ca71ba8da481cc52c6ce1c715e6e97818c9b48d13df49c873517d23d59085adb5dd20d6b52bd521ef2cdd5eb9246a3d8b 4757e8d3f729e245eb2b260a0238fd010000ffff0300504b03041400060008000000210030dd4329a8060000a41b0000160000007468656d652f7468656d652f 7468656d65312e786d6cec594f6fdb3614bf0fd87720746f6327761a07758ad8b19b2d4d1bc46e871e698996d850a240d2497d1bdae38001c3ba618715d86d87 615b8116d8a5fb34d93a6c1dd0afb0475292c5585e9236d88aad3e2412f9e3fbff1e1fa9abd7eec70c1d1221294fda5efd72cd4324f1794093b0eddd1ef62fad 79482a9c0498f184b4bd2991deb58df7dfbb8ad755446282607d22d771db8b944ad79796a40fc3585ee62949606ecc458c15bc8a702910f808e8c66c69b9565b 5d8a314d3c94e018c8de1a8fa94fd05093f43672e23d06af89927ac06762a049136785c10607758d9053d965021d62d6f6804fc08f86e4bef210c352c144dbab 999fb7b4717509af678b985ab0b6b4ae6f7ed9ba6c4170b06c788a705430adf71bad2b5b057d03606a1ed7ebf5babd7a41cf00b0ef83a6569632cd467faddec9 699640f6719e76b7d6ac355c7c89feca9cccad4ea7d36c65b258a206641f1b73f8b5da6a6373d9c11b90c537e7f08dce66b7bbeae00dc8e257e7f0fd2badd586 8b37a088d1e4600ead1ddaef67d40bc898b3ed4af81ac0d76a197c86826828a24bb318f3442d8ab518dfe3a20f000d6458d104a9694ac6d88728eee2782428d6 0cf03ac1a5193be4cbb921cd0b495fd054b5bd0f530c1931a3f7eaf9f7af9e3f45c70f9e1d3ff8e9f8e1c3e3073f5a42ceaa6d9c84e5552fbffdeccfc71fa33f 9e7ef3f2d117d57859c6fffac327bffcfc793510d26726ce8b2f9ffcf6ecc98baf3efdfdbb4715f04d814765f890c644a29be408edf3181433567125272371be 15c308d3f28acd249438c19a4b05fd9e8a1cf4cd296699771c393ac4b5e01d01e5a30a787d72cf1178108989a2159c77a2d801ee72ce3a5c545a6147f32a9979 3849c26ae66252c6ed637c58c5bb8b13c7bfbd490a75330f4b47f16e441c31f7184e140e494214d273fc80900aedee52ead87597fa824b3e56e82e451d4c2b4d 32a423279a668bb6690c7e9956e90cfe766cb37b077538abd27a8b1cba48c80acc2a841f12e698f13a9e281c57911ce298950d7e03aba84ac8c154f8655c4f2a f074481847bd804859b5e696007d4b4edfc150b12addbecba6b18b148a1e54d1bc81392f23b7f84137c2715a851dd0242a633f900710a218ed715505dfe56e86 e877f0034e16bafb0e258ebb4faf06b769e888340b103d331115bebc4eb813bf83291b63624a0d1475a756c734f9bbc2cd28546ecbe1e20a3794ca175f3fae90 fb6d2dd99bb07b55e5ccf68942bd0877b23c77b908e8db5f9db7f024d9239010f35bd4bbe2fcae387bfff9e2bc289f2fbe24cfaa301468dd8bd846dbb4ddf1c2 ae7b4c191ba8292337a469bc25ec3d411f06f53a73e224c5292c8de0516732307070a1c0660d125c7d44553488700a4d7bddd3444299910e254ab984c3a219ae a4adf1d0f82b7bd46cea4388ad1c12ab5d1ed8e1153d9c9f350a3246aad01c6873462b9ac05999ad5cc988826eafc3acae853a33b7ba11cd1445875ba1b236b1 399483c90bd560b0b0263435085a21b0f22a9cf9356b38ec6046026d77eba3dc2dc60b17e92219e180643ed27acffba86e9c94c7ca9c225a0f1b0cfae0788ad5 4adc5a9aec1b703b8b93caec1a0bd8e5de7b132fe5113cf312503b998e2c2927274bd051db6b35979b1ef271daf6c6704e86c73805af4bdd476216c26593af84 0dfb5393d964f9cc9bad5c313709ea70f561ed3ea7b053075221d51696910d0d339585004b34272bff7213cc7a510a5454a3b349b1b206c1f0af490176745d4b c663e2abb2b34b23da76f6352ba57ca2881844c1111ab189d8c7e07e1daaa04f40255c77988aa05fe06e4e5bdb4cb9c5394bbaf28d98c1d971ccd20867e556a7 689ec9166e0a522183792b8907ba55ca6e943bbf2a26e52f48957218ffcf54d1fb09dc3eac04da033e5c0d0b8c74a6b43d2e54c4a10aa511f5fb021a07533b20 5ae07e17a621a8e082dafc17e450ffb739676998b48643a4daa7211214f623150942f6a02c99e83b85583ddbbb2c4996113211551257a656ec1139246ca86be0 aadedb3d1441a89b6a929501833b197fee7b9641a3503739e57c732a59b1f7da1cf8a73b1f9bcca0945b874d4393dbbf10b1680f66bbaa5d6f96e77b6f59113d 316bb31a795600b3d256d0cad2fe354538e7566b2bd69cc6cbcd5c38f0e2bcc63058344429dc2121fd07f63f2a7c66bf76e80d75c8f7a1b622f878a18941d840 545fb28d07d205d20e8ea071b283369834296bdaac75d256cb37eb0bee740bbe278cad253b8bbfcf69eca23973d939b97891c6ce2cecd8da8e2d343578f6648a c2d0383fc818c798cf64e52f597c740f1cbd05df0c264c49134cf09d4a60e8a107260f20f92d47b374e32f000000ffff0300504b030414000600080000002100 0dd1909fb60000001b010000270000007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73848f4d0ac2301484f7 8277086f6fd3ba109126dd88d0add40384e4350d363f2451eced0dae2c082e8761be9969bb979dc9136332de3168aa1a083ae995719ac16db8ec8e4052164e89 d93b64b060828e6f37ed1567914b284d262452282e3198720e274a939cd08a54f980ae38a38f56e422a3a641c8bbd048f7757da0f19b017cc524bd62107bd500 1996509affb3fd381a89672f1f165dfe514173d9850528a2c6cce0239baa4c04ca5bbabac4df000000ffff0300504b01022d0014000600080000002100e9de0f bfff0000001c0200001300000000000000000000000000000000005b436f6e74656e745f54797065735d2e786d6c504b01022d0014000600080000002100a5d6 a7e7c0000000360100000b00000000000000000000000000300100005f72656c732f2e72656c73504b01022d00140006000800000021006b799616830000008a 0000001c00000000000000000000000000190200007468656d652f7468656d652f7468656d654d616e616765722e786d6c504b01022d00140006000800000021 0030dd4329a8060000a41b00001600000000000000000000000000d60200007468656d652f7468656d652f7468656d65312e786d6c504b01022d001400060008 00000021000dd1909fb60000001b0100002700000000000000000000000000b20900007468656d652f7468656d652f5f72656c732f7468656d654d616e616765722e786d6c2e72656c73504b050600000000050005005d010000ad0a00000000} {\*\colorschememapping 3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d225554462d3822207374616e64616c6f6e653d22796573223f3e0d0a3c613a636c724d 617020786d6c6e733a613d22687474703a2f2f736368656d61732e6f70656e786d6c666f726d6174732e6f72672f64726177696e676d6c2f323030362f6d6169 6e22206267313d226c743122207478313d22646b3122206267323d226c743222207478323d22646b322220616363656e74313d22616363656e74312220616363 656e74323d22616363656e74322220616363656e74333d22616363656e74332220616363656e74343d22616363656e74342220616363656e74353d22616363656e74352220616363656e74363d22616363656e74362220686c696e6b3d22686c696e6b2220666f6c486c696e6b3d22666f6c486c696e6b222f3e} {\*\latentstyles\lsdstimax267\lsdlockeddef0\lsdsemihiddendef1\lsdunhideuseddef1\lsdqformatdef0\lsdprioritydef99{\lsdlockedexcept \lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority0 \lsdlocked0 Normal; \lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 1;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 2;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 3;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 4; \lsdqformat1 \lsdpriority9 \lsdlocked0 heading 5;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 6;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 7;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 8;\lsdqformat1 \lsdpriority9 \lsdlocked0 heading 9; \lsdpriority39 \lsdlocked0 toc 1;\lsdpriority39 \lsdlocked0 toc 2;\lsdpriority39 \lsdlocked0 toc 3;\lsdpriority39 \lsdlocked0 toc 4;\lsdpriority39 \lsdlocked0 toc 5;\lsdpriority39 \lsdlocked0 toc 6;\lsdpriority39 \lsdlocked0 toc 7; \lsdpriority39 \lsdlocked0 toc 8;\lsdpriority39 \lsdlocked0 toc 9;\lsdqformat1 \lsdpriority35 \lsdlocked0 caption;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority10 \lsdlocked0 Title;\lsdpriority1 \lsdlocked0 Default Paragraph Font; \lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority11 \lsdlocked0 Subtitle;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority22 \lsdlocked0 Strong;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority20 \lsdlocked0 Emphasis; \lsdsemihidden0 \lsdunhideused0 \lsdpriority59 \lsdlocked0 Table Grid;\lsdunhideused0 \lsdlocked0 Placeholder Text;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority1 \lsdlocked0 No Spacing; \lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid; \lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1; \lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2; \lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading; \lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 1; \lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 1; \lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 1;\lsdunhideused0 \lsdlocked0 Revision; \lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority34 \lsdlocked0 List Paragraph;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority29 \lsdlocked0 Quote;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority30 \lsdlocked0 Intense Quote; \lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 1; \lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 1; \lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 1;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 2; \lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 2; \lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 2; \lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 2; \lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 2; \lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 2;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 3; \lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 3; \lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 3; \lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 3; \lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 3;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 3; \lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 4; \lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 4; \lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 4; \lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 4; \lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 4;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 5; \lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 5; \lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 5; \lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 5; \lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 5; \lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 5;\lsdsemihidden0 \lsdunhideused0 \lsdpriority60 \lsdlocked0 Light Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority61 \lsdlocked0 Light List Accent 6; \lsdsemihidden0 \lsdunhideused0 \lsdpriority62 \lsdlocked0 Light Grid Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority63 \lsdlocked0 Medium Shading 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority64 \lsdlocked0 Medium Shading 2 Accent 6; \lsdsemihidden0 \lsdunhideused0 \lsdpriority65 \lsdlocked0 Medium List 1 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority66 \lsdlocked0 Medium List 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority67 \lsdlocked0 Medium Grid 1 Accent 6; \lsdsemihidden0 \lsdunhideused0 \lsdpriority68 \lsdlocked0 Medium Grid 2 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority69 \lsdlocked0 Medium Grid 3 Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority70 \lsdlocked0 Dark List Accent 6; \lsdsemihidden0 \lsdunhideused0 \lsdpriority71 \lsdlocked0 Colorful Shading Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority72 \lsdlocked0 Colorful List Accent 6;\lsdsemihidden0 \lsdunhideused0 \lsdpriority73 \lsdlocked0 Colorful Grid Accent 6; \lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority19 \lsdlocked0 Subtle Emphasis;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority21 \lsdlocked0 Intense Emphasis; \lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority31 \lsdlocked0 Subtle Reference;\lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority32 \lsdlocked0 Intense Reference; \lsdsemihidden0 \lsdunhideused0 \lsdqformat1 \lsdpriority33 \lsdlocked0 Book Title;\lsdpriority37 \lsdlocked0 Bibliography;\lsdqformat1 \lsdpriority39 \lsdlocked0 TOC Heading;}}{\*\datastore 010500000200000018000000 4d73786d6c322e534158584d4c5265616465722e362e3000000000000000000000060000 d0cf11e0a1b11ae1000000000000000000000000000000003e000300feff090006000000000000000000000001000000010000000000000000100000feffffff00000000feffffff0000000000000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff fffffffffffffffffdfffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffff52006f006f007400200045006e00740072007900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016000500ffffffffffffffffffffffff0c6ad98892f1d411a65f0040963251e50000000000000000000000006007 a9110737cb01feffffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff00000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ffffffffffffffffffffffff000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000105000000000000}}
115371172-shuffle
client/docs/manual.rtf
Rich Text Format
asf20
59,942
package org.dodgybits.shuffle.web.client.formatter; import java.util.Date; import org.dodgybits.shuffle.web.client.model.TaskValue; import com.google.gwt.i18n.client.DateTimeFormat; public class ActionDateFormatter { private DateTimeFormat dateFormat; public ActionDateFormatter() { dateFormat = DateTimeFormat.getFormat("d MMM"); } public String getShortDueDate(TaskValue taskValue) { Date date = taskValue.getDueDate(); String result = ""; if (date != null) { if (isSameDay(date, new Date())) { // only show time if date is today result = DateTimeFormat.getShortTimeFormat().format(date); } else { result = dateFormat.format(date); } } return result; } @SuppressWarnings("deprecation") private static boolean isSameDay(Date date1, Date date2) { return date1.getYear() == date2.getYear() && date1.getMonth() == date2.getMonth() && date1.getDate() == date2.getDate(); } }
115371172-shuffle
server/src/org/dodgybits/shuffle/web/client/formatter/ActionDateFormatter.java
Java
asf20
930
package org.dodgybits.shuffle.web.client; import com.google.gwt.core.client.GWT; import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.resources.client.CssResource; import com.google.gwt.uibinder.client.UiBinder; import com.google.gwt.uibinder.client.UiField; import com.google.gwt.uibinder.client.UiHandler; import com.google.gwt.user.client.Window; import com.google.gwt.user.client.ui.Anchor; import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.Widget; public class Navigation extends Composite { interface Binder extends UiBinder<Widget, Navigation> { } interface Style extends CssResource { String item(); } private static final Binder binder = GWT.create(Binder.class); @UiField Style style; @UiField Anchor inboxLink; @UiField Anchor dueActionsLink; @UiField Anchor nextActionsLink; @UiField Anchor projectsLink; @UiField Anchor contextsLink; public Navigation() { initWidget(binder.createAndBindUi(this)); } @UiHandler("inboxLink") void onInboxClicked(ClickEvent event) { // TODO dispatch event or some such thing Window.alert("Loading inbox"); } @UiHandler("projectsLink") void onProjectsClicked(ClickEvent event) { // TODO dispatch event or some such thing Window.alert("Loading projects"); } }
115371172-shuffle
server/src/org/dodgybits/shuffle/web/client/Navigation.java
Java
asf20
1,342
package org.dodgybits.shuffle.web.client.gin; import org.dodgybits.shuffle.web.client.formatter.ActionDateFormatter; import org.dodgybits.shuffle.web.client.model.LoginInfo; import com.google.gwt.event.shared.HandlerManager; import com.google.gwt.inject.client.AbstractGinModule; import com.google.inject.Singleton; public class ShuffleGinModule extends AbstractGinModule { protected void configure() { bind(ActionDateFormatter.class).in(Singleton.class); bind(LoginInfo.class).in(Singleton.class); // event hub (TODO hide this from project classes) bind(HandlerManager.class).in(Singleton.class); } }
115371172-shuffle
server/src/org/dodgybits/shuffle/web/client/gin/ShuffleGinModule.java
Java
asf20
626
package org.dodgybits.shuffle.web.client.gin; import org.dodgybits.shuffle.web.client.Main; import com.google.gwt.inject.client.Ginjector; public interface ShuffleGinjector extends Ginjector { Main getMain(); }
115371172-shuffle
server/src/org/dodgybits/shuffle/web/client/gin/ShuffleGinjector.java
Java
asf20
215
package org.dodgybits.shuffle.web.client; import com.google.gwt.user.client.ui.ResizeComposite; import com.google.inject.Inject; public class CentrePanel extends ResizeComposite { TaskList taskList; @Inject public CentrePanel(TaskList taskList) { this.taskList = taskList; initWidget(taskList); } }
115371172-shuffle
server/src/org/dodgybits/shuffle/web/client/CentrePanel.java
Java
asf20
328
/* * 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. */ package org.dodgybits.shuffle.web.client; import org.dodgybits.shuffle.web.client.model.LoginInfo; import org.dodgybits.shuffle.web.client.service.LoginServiceAsync; import com.google.gwt.core.client.GWT; import com.google.gwt.dom.client.SpanElement; import com.google.gwt.uibinder.client.UiBinder; import com.google.gwt.uibinder.client.UiField; import com.google.gwt.user.client.Window.Location; import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.ui.Anchor; import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.Widget; import com.google.inject.Inject; /** * The top panel, which contains the 'welcome' message and various links. */ public class TopPanel extends Composite { interface Binder extends UiBinder<Widget, TopPanel> { } private static final Binder binder = GWT.create(Binder.class); @Inject ShuffleConstants constants; @UiField SpanElement emailSpan; @UiField Anchor loginLink; @UiField Anchor settingsLink; @Inject public TopPanel(LoginServiceAsync loginService, final LoginInfo loginInfo) { initWidget(binder.createAndBindUi(this)); loginService.login(getModuleUrl(), new AsyncCallback<LoginInfo>() { public void onFailure(Throwable error) { } public void onSuccess(LoginInfo result) { loginInfo.populate(result); if(loginInfo.isLoggedIn()) { loginLink.setText(constants.signOut()); loginLink.setHref(loginInfo.getLogoutUrl()); emailSpan.setInnerText(loginInfo.getEmailAddress()); } else { loginLink.setText(constants.signIn()); loginLink.setHref(loginInfo.getLoginUrl()); emailSpan.setInnerText(""); } } }); } private String getModuleUrl() { String url = Location.getPath(); String gwtCodeSvrParam = Location.getParameter("gwt.codesvr"); if (!"".equals(gwtCodeSvrParam)) { url += "?gwt.codesvr=" + gwtCodeSvrParam; } return url; } }
115371172-shuffle
server/src/org/dodgybits/shuffle/web/client/TopPanel.java
Java
asf20
2,640
package org.dodgybits.shuffle.web.client; import com.google.gwt.i18n.client.Constants; import com.google.gwt.i18n.client.LocalizableResource.DefaultLocale; @DefaultLocale("en") // not required since this is the default public interface ShuffleConstants extends Constants { @DefaultStringValue("Sign In") String signIn(); @DefaultStringValue("Sign Out") String signOut(); }
115371172-shuffle
server/src/org/dodgybits/shuffle/web/client/ShuffleConstants.java
Java
asf20
389
body, table { font-size: small; } body { font-family: Helvetica, Arial, sans-serif; color: #000; background: #fff; } a:link, a:visited, a:hover, a:active { color: #000; } /* Dialog boxes */ .dialogTopLeftInner, .dialogMiddleLeftInner, .dialogBottomLeftInner, .dialogTopRightInner, .dialogMiddleRightInner, .dialogBottomRightInner { display: none; } .gwt-DialogBox { background-color: white; border: 1px solid #666; z-index: 2; } .gwt-DialogBox .Caption { background: #d3d6dd url(gradient_bg_th.png) repeat-x bottom left; font-weight: bold; text-shadow: #fff 0 2px 2px; cursor: default; padding: 5px 10px; border-bottom: 1px solid #999; text-align: left; } .gwt-DialogBox .dialogContent { } .gwt-DialogBox .gwt-Button { margin: 10px; } .gwt-PopupPanelGlass { background-color: #000; opacity: 0.3; filter: literal("alpha(opacity=30)"); z-index: 2; } /* GWT Tree */ .gwt-Tree { } .gwt-Tree .gwt-TreeItem { padding: 0; cursor: hand; cursor: pointer; display: block !important; } .gwt-Tree .gwt-TreeItem-selected { background: #ccc; } /* Splitters */ .gwt-SplitLayoutPanel-HDragger { cursor: col-resize; } .gwt-SplitLayoutPanel-VDragger { cursor: row-resize; } /* Action tables */ .actionTitle { white-space: nowrap; } .actionDetails { white-space: nowrap; color: gray; } .actionDueInFuture { } .actionDueInPass { color: red; }
115371172-shuffle
server/src/org/dodgybits/shuffle/web/client/global.css
CSS
asf20
1,427
package org.dodgybits.shuffle.web.client.service; import java.io.Serializable; public class NotLoggedInException extends Exception implements Serializable { public NotLoggedInException() { super(); } public NotLoggedInException(String message) { super(message); } }
115371172-shuffle
server/src/org/dodgybits/shuffle/web/client/service/NotLoggedInException.java
Java
asf20
287
package org.dodgybits.shuffle.web.client.service; import org.dodgybits.shuffle.web.client.model.LoginInfo; import com.google.gwt.user.client.rpc.RemoteService; import com.google.gwt.user.client.rpc.RemoteServiceRelativePath; @RemoteServiceRelativePath("login") public interface LoginService extends RemoteService { public LoginInfo login(String requestUri); }
115371172-shuffle
server/src/org/dodgybits/shuffle/web/client/service/LoginService.java
Java
asf20
365
package org.dodgybits.shuffle.web.client.service; import org.dodgybits.shuffle.web.client.model.LoginInfo; import com.google.gwt.user.client.rpc.AsyncCallback; public interface LoginServiceAsync { public void login(String requestUri, AsyncCallback<LoginInfo> async); }
115371172-shuffle
server/src/org/dodgybits/shuffle/web/client/service/LoginServiceAsync.java
Java
asf20
274
package org.dodgybits.shuffle.web.client.service; import java.util.ArrayList; import org.dodgybits.shuffle.web.client.model.TaskFilter; import org.dodgybits.shuffle.web.client.model.TaskOrdering; import org.dodgybits.shuffle.web.client.model.TaskValue; import com.google.gwt.user.client.rpc.RemoteService; import com.google.gwt.user.client.rpc.RemoteServiceRelativePath; @RemoteServiceRelativePath("task") public interface TaskService extends RemoteService { ArrayList<TaskValue> getMockTasks() throws NotLoggedInException; ArrayList<TaskValue> getTasks(TaskFilter filter, TaskOrdering order) throws NotLoggedInException; TaskValue saveTask(TaskValue taskValue) throws NotLoggedInException; }
115371172-shuffle
server/src/org/dodgybits/shuffle/web/client/service/TaskService.java
Java
asf20
712
package org.dodgybits.shuffle.web.client.service; import com.google.gwt.user.client.Window; import com.google.gwt.user.client.rpc.AsyncCallback; public abstract class ErrorHandlingAsyncCallback<T> implements AsyncCallback<T> { @Override public void onFailure(Throwable caught) { Window.alert(caught.getMessage()); } }
115371172-shuffle
server/src/org/dodgybits/shuffle/web/client/service/ErrorHandlingAsyncCallback.java
Java
asf20
329
package org.dodgybits.shuffle.web.client.service; import java.util.ArrayList; import org.dodgybits.shuffle.web.client.model.TaskFilter; import org.dodgybits.shuffle.web.client.model.TaskOrdering; import org.dodgybits.shuffle.web.client.model.TaskValue; import com.google.gwt.user.client.rpc.AsyncCallback; public interface TaskServiceAsync { void getMockTasks(AsyncCallback<ArrayList<TaskValue>> callback); void getTasks(TaskFilter filter, TaskOrdering order, AsyncCallback<ArrayList<TaskValue>> callback); void saveTask(TaskValue taskValue, AsyncCallback<TaskValue> callback); }
115371172-shuffle
server/src/org/dodgybits/shuffle/web/client/service/TaskServiceAsync.java
Java
asf20
599
package org.dodgybits.shuffle.web.client; import java.util.ArrayList; import java.util.Date; import org.dodgybits.shuffle.web.client.command.GetTasksCommand; import org.dodgybits.shuffle.web.client.command.SaveTaskCommand; import org.dodgybits.shuffle.web.client.formatter.ActionDateFormatter; import org.dodgybits.shuffle.web.client.model.TaskValue; import org.dodgybits.shuffle.web.client.service.ErrorHandlingAsyncCallback; import com.google.gwt.core.client.GWT; import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.event.dom.client.ClickHandler; import com.google.gwt.resources.client.CssResource; import com.google.gwt.uibinder.client.UiBinder; import com.google.gwt.uibinder.client.UiField; import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.Element; import com.google.gwt.user.client.ui.FlexTable; import com.google.gwt.user.client.ui.FlowPanel; import com.google.gwt.user.client.ui.ResizeComposite; import com.google.gwt.user.client.ui.Widget; import com.google.gwt.user.client.ui.HTMLTable.Cell; import com.google.inject.Inject; /** * A composite that displays a list of actions. */ public class TaskList extends ResizeComposite implements ClickHandler { interface Binder extends UiBinder<Widget, TaskList> { } interface SelectionStyle extends CssResource { String selectedRow(); } private static final Binder sBinder = GWT.create(Binder.class); private ActionDateFormatter mFormatter; private GetTasksCommand.Factory mGetTasksFactory; private SaveTaskCommand.Factory mSaveTaskFactory; private ArrayList<TaskValue> taskValues; @UiField FlowPanel header; @UiField FlowPanel footer; @UiField FlexTable table; @UiField SelectionStyle selectionStyle; @Inject public TaskList(GetTasksCommand.Factory factory, SaveTaskCommand.Factory saveTaskFactory, ActionDateFormatter formatter) { mGetTasksFactory = factory; mSaveTaskFactory = saveTaskFactory; mFormatter = formatter; initWidget(sBinder.createAndBindUi(this)); initTable(); } private void initTable() { // Initialize the table. table.getColumnFormatter().setWidth(1, "10em"); table.addClickHandler(this); fetchActions(); } private void fetchActions() { GetTasksCommand command = mGetTasksFactory .create(new ErrorHandlingAsyncCallback<ArrayList<TaskValue>>() { @Override public void onSuccess(ArrayList<TaskValue> result) { taskValues = result; displayActions(); } }); command.execute(); } private void saveAction(final int taskValueIndex) { TaskValue task = taskValues.get(taskValueIndex); SaveTaskCommand command = mSaveTaskFactory .create(task, new ErrorHandlingAsyncCallback<TaskValue>() { @Override public void onSuccess(TaskValue result) { taskValues.set(taskValueIndex, result); } }); command.execute(); } private void displayActions() { int numActions = taskValues.size(); for (int i = 0; i < numActions; i++) { TaskValue taskValue = taskValues.get(i); displayAction(taskValue, i); } } @Override public void onClick(ClickEvent event) { Cell clickedCell = table.getCellForEvent(event); int rowIndex = clickedCell.getRowIndex(); saveAction(rowIndex); } private void displayAction(TaskValue taskValue, int row) { String description = "<div class='actionTitle'>" + escapeHtml(taskValue.getTitle()) + "<span class='actionDetails'> - " + escapeHtml(taskValue.getDetails()) + "</span></div>"; table.setHTML(row, 0, description); table.setText(row, 1, mFormatter.getShortDueDate(taskValue)); table.getCellFormatter().setStyleName( row, 1, isInPast(taskValue.getDueDate()) ? "actionDueInPass" : "actionDueInFuture"); } private static String escapeHtml(String maybeHtml) { final Element div = DOM.createDiv(); DOM.setInnerText(div, maybeHtml); return DOM.getInnerHTML(div); } private static boolean isInPast(Date date) { return date != null && date.getTime() < System.currentTimeMillis(); } }
115371172-shuffle
server/src/org/dodgybits/shuffle/web/client/TaskList.java
Java
asf20
4,611
package org.dodgybits.shuffle.web.client; import com.google.gwt.core.client.GWT; import com.google.gwt.uibinder.client.UiBinder; import com.google.gwt.uibinder.client.UiField; import com.google.gwt.user.client.ui.DockLayoutPanel; import com.google.gwt.user.client.ui.ResizeComposite; import com.google.inject.Inject; public class Main extends ResizeComposite { interface Binder extends UiBinder<DockLayoutPanel, Main> { } private static final Binder binder = GWT.create(Binder.class); @UiField(provided=true) TopPanel topPanel; @UiField(provided=true) Navigation navigation; @UiField(provided=true) CentrePanel centrePanel; @Inject public Main(TopPanel topPanel, Navigation navigation, CentrePanel centrePanel) { this.topPanel = topPanel; this.navigation = navigation; this.centrePanel = centrePanel; // Create the UI defined in Main.ui.xml. DockLayoutPanel outer = binder.createAndBindUi(this); initWidget(outer); } }
115371172-shuffle
server/src/org/dodgybits/shuffle/web/client/Main.java
Java
asf20
966
package org.dodgybits.shuffle.web.client.model; import java.io.Serializable; public class LoginInfo implements Serializable { private boolean loggedIn = false; private String loginUrl; private String logoutUrl; private String emailAddress; private String nickname; public boolean isLoggedIn() { return loggedIn; } public void setLoggedIn(boolean loggedIn) { this.loggedIn = loggedIn; } public String getLoginUrl() { return loginUrl; } public void setLoginUrl(String loginUrl) { this.loginUrl = loginUrl; } public String getLogoutUrl() { return logoutUrl; } public void setLogoutUrl(String logoutUrl) { this.logoutUrl = logoutUrl; } public String getEmailAddress() { return emailAddress; } public void setEmailAddress(String emailAddress) { this.emailAddress = emailAddress; } public String getNickname() { return nickname; } public void setNickname(String nickname) { this.nickname = nickname; } public void populate(LoginInfo info) { loggedIn = info.loggedIn; loginUrl = info.loginUrl; logoutUrl = info.logoutUrl; emailAddress = info.emailAddress; nickname = info.nickname; } }
115371172-shuffle
server/src/org/dodgybits/shuffle/web/client/model/LoginInfo.java
Java
asf20
1,222
package org.dodgybits.shuffle.web.client.model; import java.io.Serializable; @SuppressWarnings("serial") public class ProjectValue implements Serializable { private KeyValue<ProjectValue> mKeyValue; private String mName; private KeyValue<ContextValue> mDefaultContextId; @SuppressWarnings("unused") private ProjectValue() { // required for GWT serialization } public ProjectValue(KeyValue<ProjectValue> id, String name, KeyValue<ContextValue> defaultContextId) { mKeyValue = id; mName = name; mDefaultContextId = defaultContextId; } public final KeyValue<ProjectValue> getId() { return mKeyValue; } public final String getName() { return mName; } public final KeyValue<ContextValue> getDefaultContextId() { return mDefaultContextId; } public static final class Builder { private KeyValue<ProjectValue> mKeyValue; private String mName; private KeyValue<ContextValue> mDefaultContextId; public Builder setId(KeyValue<ProjectValue> id) { mKeyValue = id; return this; } public Builder setName(String name) { mName = name; return this; } public Builder setDefaultContextId(KeyValue<ContextValue> id) { mDefaultContextId = id; return this; } public ProjectValue build() { return new ProjectValue(mKeyValue, mName, mDefaultContextId); } } }
115371172-shuffle
server/src/org/dodgybits/shuffle/web/client/model/ProjectValue.java
Java
asf20
1,482
package org.dodgybits.shuffle.web.client.model; import java.io.Serializable; @SuppressWarnings("serial") public class TaskOrdering implements Serializable { }
115371172-shuffle
server/src/org/dodgybits/shuffle/web/client/model/TaskOrdering.java
Java
asf20
162
package org.dodgybits.shuffle.web.client.model; import java.io.Serializable; import java.util.ArrayList; import java.util.Date; @SuppressWarnings("serial") public class TaskValue implements Serializable { private KeyValue<TaskValue> mKeyValue; private String mTitle; private String mDetails; private KeyValue<ProjectValue> mProjectId; private ArrayList<KeyValue<ContextValue>> mContextIds; private Date mDueDate; @SuppressWarnings("unused") private TaskValue() { // required for GWT serialization } public TaskValue( KeyValue<TaskValue> id, String title, String details, KeyValue<ProjectValue> projectId, ArrayList<KeyValue<ContextValue>> contextIds, Date dueDate) { mKeyValue = id; mTitle = title; mDetails = details; mProjectId = projectId; mContextIds = contextIds; mDueDate = dueDate; } public final KeyValue<TaskValue> getId() { return mKeyValue; } public final String getTitle() { return mTitle; } public final String getDetails() { return mDetails; } public final KeyValue<ProjectValue> getProjectId() { return mProjectId; } public final ArrayList<KeyValue<ContextValue>> getContextIds() { return mContextIds; } public final Date getDueDate() { return mDueDate; } public static final class Builder { private KeyValue<TaskValue> mKeyValue; private String mTitle; private String mDetails; private KeyValue<ProjectValue> mProjectId; private ArrayList<KeyValue<ContextValue>> mContextIds; private Date mDueDate; public Builder setId(KeyValue<TaskValue> id) { mKeyValue = id; return this; } public final Builder setKeyValue(KeyValue<TaskValue> keyValue) { mKeyValue = keyValue; return this; } public final Builder setTitle(String title) { mTitle = title; return this; } public final Builder setDetails(String details) { mDetails = details; return this; } public final Builder setProjectId(KeyValue<ProjectValue> projectId) { mProjectId = projectId; return this; } public final Builder setContextIds(ArrayList<KeyValue<ContextValue>> contextIds) { mContextIds = contextIds; return this; } public final Builder setDueDate(Date dueDate) { mDueDate = dueDate; return this; } public TaskValue build() { return new TaskValue(mKeyValue, mTitle, mDetails, mProjectId, mContextIds, mDueDate); } } }
115371172-shuffle
server/src/org/dodgybits/shuffle/web/client/model/TaskValue.java
Java
asf20
2,681
package org.dodgybits.shuffle.web.client.model; import java.io.Serializable; @SuppressWarnings("serial") public class KeyValue<T> implements Serializable { private String mKey; @SuppressWarnings("unused") private KeyValue() { // required for GWT serialization } public KeyValue(String key) { mKey = key; } public final String getValue() { return mKey; } }
115371172-shuffle
server/src/org/dodgybits/shuffle/web/client/model/KeyValue.java
Java
asf20
376
package org.dodgybits.shuffle.web.client.model; import java.io.Serializable; import java.util.ArrayList; @SuppressWarnings("serial") public class ValueSelection<T> implements Serializable { static enum SelectionType { All, Some, None } private SelectionType mType; private ArrayList<KeyValue<T>> mKeyValues; @SuppressWarnings("unused") private ValueSelection() { // required for GWT serialization } private ValueSelection(SelectionType type) { mType = type; } public ValueSelection(ArrayList<KeyValue<T>> keyValues) { if (keyValues == null || keyValues.isEmpty()) { mType = SelectionType.All; } else { mType = SelectionType.Some; mKeyValues = keyValues; } } public ValueSelection<T> createNoneSelection() { return new ValueSelection<T>(SelectionType.None); } public ValueSelection<T> createAllSelection() { return new ValueSelection<T>(SelectionType.All); } public boolean isNone() { return mType == SelectionType.None; } public boolean isAll() { return mType == SelectionType.All; } public ArrayList<KeyValue<T>> getKeyValues() { return mKeyValues; } @Override public String toString() { String result; switch (mType) { case All: result="All"; break; case None: result="None"; break; default: result = mKeyValues.toString(); break; } return "[ValueSelection " + result + "]"; } }
115371172-shuffle
server/src/org/dodgybits/shuffle/web/client/model/ValueSelection.java
Java
asf20
1,717
package org.dodgybits.shuffle.web.client.model; public enum BooleanSelection { IncludeIfTrue, IncludeIfFalse, IncludeAll }
115371172-shuffle
server/src/org/dodgybits/shuffle/web/client/model/BooleanSelection.java
Java
asf20
128
package org.dodgybits.shuffle.web.client.model; import java.io.Serializable; @SuppressWarnings("serial") public class TaskFilter implements Serializable { public ValueSelection<ContextValue> contexts; public ValueSelection<ProjectValue> projects; public BooleanSelection isComplete; public boolean onlyTopActionPerProject; }
115371172-shuffle
server/src/org/dodgybits/shuffle/web/client/model/TaskFilter.java
Java
asf20
343
package org.dodgybits.shuffle.web.client.model; import java.io.Serializable; @SuppressWarnings("serial") public class ContextValue implements Serializable { private KeyValue<ContextValue> mKeyValue; private String mName; @SuppressWarnings("unused") private ContextValue() { // required for GWT serialization } public ContextValue(KeyValue<ContextValue> id, String name) { mKeyValue = id; mName = name; } public final KeyValue<ContextValue> getId() { return mKeyValue; } public final String getName() { return mName; } public static final class Builder { private KeyValue<ContextValue> mKeyValue; private String mName; public Builder setId(KeyValue<ContextValue> id) { mKeyValue = id; return this; } public Builder setName(String name) { mName = name; return this; } public ContextValue build() { return new ContextValue(mKeyValue, mName); } } }
115371172-shuffle
server/src/org/dodgybits/shuffle/web/client/model/ContextValue.java
Java
asf20
1,003
package org.dodgybits.shuffle.web.client; import gwtupload.client.IUploader; import gwtupload.client.SingleUploader; import org.dodgybits.shuffle.web.client.gin.ShuffleGinjector; import com.google.gwt.core.client.EntryPoint; import com.google.gwt.core.client.GWT; import com.google.gwt.resources.client.ClientBundle; import com.google.gwt.resources.client.CssResource; import com.google.gwt.resources.client.CssResource.NotStrict; import com.google.gwt.user.client.Window; import com.google.gwt.user.client.ui.RootLayoutPanel; /** * Entry point classes define <code>onModuleLoad()</code>. */ public class Shuffle implements EntryPoint, IUploader.OnFinishUploaderHandler { interface GlobalResources extends ClientBundle { @NotStrict @Source("global.css") CssResource css(); } /** * This method constructs the application user interface by instantiating * controls and hooking up event handler. */ public void onModuleLoad() { // Inject global styles. GWT.<GlobalResources> create(GlobalResources.class).css() .ensureInjected(); ShuffleGinjector ginjector = GWT.create(ShuffleGinjector.class); Main main = ginjector.getMain(); // Get rid of scrollbars, and clear out the window's built-in margin, // because we want to take advantage of the entire client area. Window.enableScrolling(false); Window.setMargin("0px"); RootLayoutPanel.get().add(main); // addUploader(); } private void addUploader() { // Create a new uploader panel and attach it to the document SingleUploader defaultUploader = new SingleUploader(); defaultUploader.setServletPath("/shuffle/restore"); RootLayoutPanel.get().add(defaultUploader); // Add a finish handler which will load the image once the upload // finishes defaultUploader.addOnFinishUploadHandler(this); } public void onFinish(IUploader uploader) { // DO SOMETHING on done... } // // /** // * The message displayed to the user when the server cannot be reached or // * returns an error. // */ // private static final String SERVER_ERROR = "An error occurred while " // + "attempting to contact the server. Please check your network " // + "connection and try again."; // // /** // * Create a remote service proxy to talk to the server-side Greeting // service. // */ // private final GreetingServiceAsync greetingService = GWT // .create(GreetingService.class); // // /** // * This is the entry point method. // */ // public void onModuleLoad() { // final Button sendButton = new Button("Send"); // final TextBox nameField = new TextBox(); // nameField.setText("GWT User"); // // // We can add style names to widgets // sendButton.addStyleName("sendButton"); // // // Add the nameField and sendButton to the RootPanel // // Use RootPanel.get() to get the entire body element // RootPanel.get("nameFieldContainer").add(nameField); // RootPanel.get("sendButtonContainer").add(sendButton); // // // Focus the cursor on the name field when the app loads // nameField.setFocus(true); // nameField.selectAll(); // // // Create the popup dialog box // final DialogBox dialogBox = new DialogBox(); // dialogBox.setText("Remote Procedure Call"); // dialogBox.setAnimationEnabled(true); // final Button closeButton = new Button("Close"); // // We can set the id of a widget by accessing its Element // closeButton.getElement().setId("closeButton"); // final Label textToServerLabel = new Label(); // final HTML serverResponseLabel = new HTML(); // VerticalPanel dialogVPanel = new VerticalPanel(); // dialogVPanel.addStyleName("dialogVPanel"); // dialogVPanel.add(new HTML("<b>Sending name to the server:</b>")); // dialogVPanel.add(textToServerLabel); // dialogVPanel.add(new HTML("<br><b>Server replies:</b>")); // dialogVPanel.add(serverResponseLabel); // dialogVPanel.setHorizontalAlignment(VerticalPanel.ALIGN_RIGHT); // dialogVPanel.add(closeButton); // dialogBox.setWidget(dialogVPanel); // // // Add a handler to close the DialogBox // closeButton.addClickHandler(new ClickHandler() { // public void onClick(ClickEvent event) { // dialogBox.hide(); // sendButton.setEnabled(true); // sendButton.setFocus(true); // } // }); // // // Create a handler for the sendButton and nameField // class MyHandler implements ClickHandler, KeyUpHandler { // /** // * Fired when the user clicks on the sendButton. // */ // public void onClick(ClickEvent event) { // sendNameToServer(); // } // // /** // * Fired when the user types in the nameField. // */ // public void onKeyUp(KeyUpEvent event) { // if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) { // sendNameToServer(); // } // } // // /** // * Send the name from the nameField to the server and wait for a response. // */ // private void sendNameToServer() { // sendButton.setEnabled(false); // String textToServer = nameField.getText(); // textToServerLabel.setText(textToServer); // serverResponseLabel.setText(""); // greetingService.greetServer(textToServer, new AsyncCallback<String>() { // public void onFailure(Throwable caught) { // // Show the RPC error message to the user // dialogBox.setText("Remote Procedure Call - Failure"); // serverResponseLabel.addStyleName("serverResponseLabelError"); // serverResponseLabel.setHTML(SERVER_ERROR); // dialogBox.center(); // closeButton.setFocus(true); // } // // public void onSuccess(String result) { // dialogBox.setText("Remote Procedure Call"); // serverResponseLabel.removeStyleName("serverResponseLabelError"); // serverResponseLabel.setHTML(result); // dialogBox.center(); // closeButton.setFocus(true); // } // }); // } // } // // // Add a handler to send the name to the server // MyHandler handler = new MyHandler(); // sendButton.addClickHandler(handler); // nameField.addKeyUpHandler(handler); // } }
115371172-shuffle
server/src/org/dodgybits/shuffle/web/client/Shuffle.java
Java
asf20
6,365
package org.dodgybits.shuffle.web.client.command; import java.util.ArrayList; import org.dodgybits.shuffle.web.client.model.TaskValue; import org.dodgybits.shuffle.web.client.service.TaskServiceAsync; import com.google.gwt.user.client.Command; import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.inject.Inject; public class GetTasksCommand implements Command { private TaskServiceAsync mService; private AsyncCallback<ArrayList<TaskValue>> mCallback; public GetTasksCommand( TaskServiceAsync service, AsyncCallback<ArrayList<TaskValue>> callback) { mService = service; mCallback = callback; } @Override public void execute() { // mService.getMockTasks(mCallback); mService.getTasks(null, null, mCallback); } public static class Factory { private TaskServiceAsync service; @Inject public Factory(TaskServiceAsync service) { this.service = service; } public GetTasksCommand create(AsyncCallback<ArrayList<TaskValue>> callback) { return new GetTasksCommand(service, callback); } } }
115371172-shuffle
server/src/org/dodgybits/shuffle/web/client/command/GetTasksCommand.java
Java
asf20
1,060
package org.dodgybits.shuffle.web.client.command; import org.dodgybits.shuffle.web.client.model.TaskValue; import org.dodgybits.shuffle.web.client.service.TaskServiceAsync; import com.google.gwt.user.client.Command; import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.inject.Inject; public class SaveTaskCommand implements Command { private TaskServiceAsync mService; private AsyncCallback<TaskValue> mCallback; private TaskValue mTaskValue; public SaveTaskCommand( TaskValue taskValue, TaskServiceAsync service, AsyncCallback<TaskValue> callback) { mTaskValue = taskValue; mService = service; mCallback = callback; } @Override public void execute() { mService.saveTask(mTaskValue, mCallback); } public static class Factory { private TaskServiceAsync service; @Inject public Factory(TaskServiceAsync service) { this.service = service; } public SaveTaskCommand create(TaskValue taskValue, AsyncCallback<TaskValue> callback) { return new SaveTaskCommand(taskValue, service, callback); } } }
115371172-shuffle
server/src/org/dodgybits/shuffle/web/client/command/SaveTaskCommand.java
Java
asf20
1,226
package org.dodgybits.shuffle.web.server.service; import org.dodgybits.shuffle.web.client.model.LoginInfo; import org.dodgybits.shuffle.web.client.service.LoginService; import com.google.appengine.api.users.User; import com.google.appengine.api.users.UserService; import com.google.appengine.api.users.UserServiceFactory; import com.google.gwt.user.server.rpc.RemoteServiceServlet; @SuppressWarnings("serial") public class LoginServiceImpl extends RemoteServiceServlet implements LoginService { public LoginInfo login(String requestUri) { UserService userService = UserServiceFactory.getUserService(); User user = userService.getCurrentUser(); LoginInfo loginInfo = new LoginInfo(); if (user != null) { loginInfo.setLoggedIn(true); loginInfo.setEmailAddress(user.getEmail()); loginInfo.setNickname(user.getNickname()); loginInfo.setLogoutUrl(userService.createLogoutURL(requestUri)); } else { loginInfo.setLoggedIn(false); loginInfo.setLoginUrl(userService.createLoginURL(requestUri)); } return loginInfo; } }
115371172-shuffle
server/src/org/dodgybits/shuffle/web/server/service/LoginServiceImpl.java
Java
asf20
1,088
package org.dodgybits.shuffle.web.server.service; import gwtupload.server.UploadAction; import gwtupload.server.exceptions.UploadActionException; import java.util.List; import java.util.logging.Logger; import javax.servlet.http.HttpServletRequest; import org.apache.commons.fileupload.FileItem; import org.dodgybits.shuffle.dto.ShuffleProtos.Catalogue; import org.dodgybits.shuffle.dto.ShuffleProtos.Context; @SuppressWarnings("serial") public class RestoreServlet extends UploadAction { private static final Logger logger = Logger.getLogger(RestoreServlet.class.getName()); /** * Override executeAction to save the received files in a custom place and * delete this items from session. */ @Override public String executeAction(HttpServletRequest request, List<FileItem> sessionFiles) throws UploadActionException { assert (sessionFiles.size() == 1); Catalogue catalogue; FileItem item = sessionFiles.iterator().next(); try { // the uploaded seems to load extra 0s at end of byte stream int size = (int)item.getSize(); byte[] data = item.get(); byte[] reduced = new byte[size]; System.arraycopy(data, 0, reduced, 0, size); catalogue = Catalogue.parseFrom(reduced); } catch (Exception e) { throw new UploadActionException(e.getMessage()); } removeSessionFileItems(request); saveAll(catalogue); return null; } private void saveAll(Catalogue catalogue) { List<Context> contexts = catalogue.getContextList(); logger.info("Saving backup: " + catalogue.toString()); } }
115371172-shuffle
server/src/org/dodgybits/shuffle/web/server/service/RestoreServlet.java
Java
asf20
1,726
package org.dodgybits.shuffle.web.server.service; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Random; import javax.jdo.PersistenceManager; import javax.jdo.Query; import org.dodgybits.shuffle.web.client.model.TaskFilter; import org.dodgybits.shuffle.web.client.model.TaskOrdering; import org.dodgybits.shuffle.web.client.model.TaskValue; import org.dodgybits.shuffle.web.client.service.NotLoggedInException; import org.dodgybits.shuffle.web.client.service.TaskService; import org.dodgybits.shuffle.web.server.model.Task; import org.dodgybits.shuffle.web.server.persistence.JdoUtils; import com.google.appengine.api.users.User; import com.google.appengine.api.users.UserService; import com.google.appengine.api.users.UserServiceFactory; import com.google.gwt.user.server.rpc.RemoteServiceServlet; @SuppressWarnings("serial") public class TaskServiceImpl extends RemoteServiceServlet implements TaskService { public ArrayList<TaskValue> getMockTasks() { ArrayList<TaskValue> result = new ArrayList<TaskValue>(10); for (int i = 0; i < 10; i++) { result.add(createRandomAction()); } return result; } @SuppressWarnings("unchecked") public ArrayList<TaskValue> getTasks(TaskFilter filter, TaskOrdering order) throws NotLoggedInException { checkLoggedIn(); ArrayList<TaskValue> taskValues = new ArrayList<TaskValue>(); PersistenceManager pm = JdoUtils.getPm(); try { Query query = pm.newQuery(Task.class); setFilter(query, filter); setOrdering(query, order); List<Task> tasks = (List<Task>) query.execute(getUser()); for (Task task : tasks) { taskValues.add(task.toTaskValue()); } } finally { JdoUtils.closePm(); } return taskValues; } public TaskValue saveTask(TaskValue taskValue) throws NotLoggedInException { checkLoggedIn(); PersistenceManager pm = JdoUtils.getPm(); Task task = Task.fromTaskValue(getUser(), taskValue); try { task = pm.makePersistent(task); } finally { JdoUtils.closePm(); } return task.toTaskValue(); } private void setFilter(Query query, TaskFilter filter) { query.setFilter("user == u"); query.declareParameters("com.google.appengine.api.users.User u"); // TODO } private void setOrdering(Query query, TaskOrdering ordering) { // TODO } private void checkLoggedIn() throws NotLoggedInException { if (getUser() == null) { throw new NotLoggedInException("Not logged in."); } } private User getUser() { UserService userService = UserServiceFactory.getUserService(); return userService.getCurrentUser(); } private static final long MILLIS_IN_DAY = 1000L * 60 * 60 * 24; private TaskValue createRandomAction() { Random rnd = new Random(); String title = titles[rnd.nextInt(titles.length)]; String description = descriptions[rnd.nextInt(descriptions.length)]; int dayOffset = rnd.nextInt(11) - 5; Date dueDate = new Date(System.currentTimeMillis() + MILLIS_IN_DAY * dayOffset); return new TaskValue(null, "XX" + title, description, null, null, dueDate); } private static final String[] titles = new String[] { "RE: St0kkMarrkett Picks Trade watch special pr news release", "St0kkMarrkett Picks Watch special pr news release news", "You are a Winner oskoxmshco", "Encrypted E-mail System (VIRUS REMOVED)", "Fw: Malcolm", "Secure Message System (VIRUS REMOVED)", "fwd: St0kkMarrkett Picks Watch special pr news releaser", "FWD: Financial Market Traderr special pr news release", "? s? uma dica r?pida !!!!! leia !!!", "re: You have to heard this", "fwd: Watcher TopNews", "VACANZE alle Mauritius", "funny" }; private static final String[] descriptions = new String[] { "URGENT -[Mon, 24 Apr 2006 02:17:27 +0000]", "URGENT TRANSACTION -[Sun, 23 Apr 2006 13:10:03 +0000]", "fw: Here it comes", "voce ganho um vale presente Boticario", "Read this ASAP", "Hot Stock Talk", "New Breed of Equity Trader", "FWD: TopWeeks the wire special pr news release", "[fwd] Read this ASAP", "Renda Extra R$1.000,00-R$2.000,00/m?s", "re: Make sure your special pr news released", "Forbidden Knowledge Conference", "decodificadores os menores pre?os", "re: Our Pick", "RE: The hottest pick Watcher", "re: You need to review this", "[re:] Our Pick", "RE: Before the be11 special pr news release", "[re:] Market TradePicks Trade watch news", "No prescription needed", "Seu novo site", "[fwd] Financial Market Trader Picker", "FWD: Top Financial Market Specialists Trader interest increases", "Os cart?es mais animados da web!!", "We will sale 4 you cebtdbwtcv", "RE: Best Top Financial Market Specialists Trader Picks" }; }
115371172-shuffle
server/src/org/dodgybits/shuffle/web/server/service/TaskServiceImpl.java
Java
asf20
5,361
package org.dodgybits.shuffle.web.server.model; import static org.dodgybits.shuffle.web.server.persistence.JdoUtils.toKey; import static org.dodgybits.shuffle.web.server.persistence.JdoUtils.toKeyValue; import java.io.Serializable; import javax.jdo.annotations.IdGeneratorStrategy; import javax.jdo.annotations.IdentityType; import javax.jdo.annotations.PersistenceCapable; import javax.jdo.annotations.Persistent; import javax.jdo.annotations.PrimaryKey; import org.dodgybits.shuffle.web.client.model.ContextValue; import org.dodgybits.shuffle.web.client.model.KeyValue; import org.dodgybits.shuffle.web.client.model.ProjectValue; import org.dodgybits.shuffle.web.client.model.ProjectValue.Builder; import com.google.appengine.api.datastore.Key; import com.google.appengine.api.users.User; @SuppressWarnings("serial") @PersistenceCapable(identityType = IdentityType.APPLICATION) public class Project implements Serializable { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Key mKey; @Persistent private User mUser; @Persistent private String mName; @Persistent private Key mDefaultContextKey; public final Key getKey() { return mKey; } public final User getUser() { return mUser; } public final String getName() { return mName; } public final Key getDefaultContextKey() { return mDefaultContextKey; } public final ProjectValue toProjectValue() { KeyValue<ProjectValue> keyValue = toKeyValue(mKey); KeyValue<ContextValue> defaultContextKey = toKeyValue(mDefaultContextKey); Builder builder = new Builder(); builder.setId(keyValue) .setName(mName) .setDefaultContextId(defaultContextKey); return builder.build(); } public static final Project fromProjectValue(User user, ProjectValue value) { Project project = new Project(); project.mKey = toKey(value.getId()); project.mName = value.getName(); project.mDefaultContextKey = toKey(value.getDefaultContextId()); project.mUser = user; return project; } }
115371172-shuffle
server/src/org/dodgybits/shuffle/web/server/model/Project.java
Java
asf20
2,210
package org.dodgybits.shuffle.web.server.model; import static org.dodgybits.shuffle.web.server.persistence.JdoUtils.toKey; import static org.dodgybits.shuffle.web.server.persistence.JdoUtils.toKeys; import static org.dodgybits.shuffle.web.server.persistence.JdoUtils.toKeyValue; import static org.dodgybits.shuffle.web.server.persistence.JdoUtils.toKeyValues; import java.io.Serializable; import java.util.ArrayList; import java.util.Date; import java.util.List; import javax.jdo.annotations.IdGeneratorStrategy; import javax.jdo.annotations.IdentityType; import javax.jdo.annotations.PersistenceCapable; import javax.jdo.annotations.Persistent; import javax.jdo.annotations.PrimaryKey; import org.dodgybits.shuffle.web.client.model.ContextValue; import org.dodgybits.shuffle.web.client.model.KeyValue; import org.dodgybits.shuffle.web.client.model.ProjectValue; import org.dodgybits.shuffle.web.client.model.TaskValue; import org.dodgybits.shuffle.web.client.model.TaskValue.Builder; import com.google.appengine.api.datastore.Key; import com.google.appengine.api.datastore.Text; import com.google.appengine.api.users.User; @SuppressWarnings("serial") @PersistenceCapable(identityType = IdentityType.APPLICATION) public class Task implements Serializable { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Key mKey; @Persistent private User user; @Persistent private String mTitle; @Persistent private Text mDetails; @Persistent private Key mProjectKey; @Persistent private List<Key> mContextKeys; @Persistent private Date mDueDate; public final Key getKey() { return mKey; } public final User getUser() { return user; } public final String getTitle() { return mTitle; } public final Text getDetails() { return mDetails; } public final Key getProjectId() { return mProjectKey; } public final List<Key> getContextIds() { return mContextKeys; } public final Date getDueDate() { return mDueDate; } public final TaskValue toTaskValue() { KeyValue<TaskValue> keyValue = toKeyValue(mKey); KeyValue<ProjectValue> projectKey = toKeyValue(mProjectKey); ArrayList<KeyValue<ContextValue>> contextKeys = toKeyValues(mContextKeys); Builder builder = new Builder(); builder.setId(keyValue) .setTitle(mTitle) .setDetails(mDetails == null ? null : mDetails.getValue()) .setProjectId(projectKey) .setContextIds(contextKeys) .setDueDate(mDueDate); return builder.build(); } public static final Task fromTaskValue(User user, TaskValue value) { Task task = new Task(); task.mKey = toKey(value.getId()); task.user = user; task.mTitle = value.getTitle(); task.mDetails = new Text(value.getDetails()); task.mProjectKey = toKey(value.getProjectId()); task.mContextKeys = toKeys(value.getContextIds()); task.mDueDate = value.getDueDate(); return task; } }
115371172-shuffle
server/src/org/dodgybits/shuffle/web/server/model/Task.java
Java
asf20
3,093
package org.dodgybits.shuffle.web.server.model; import static org.dodgybits.shuffle.web.server.persistence.JdoUtils.toKey; import static org.dodgybits.shuffle.web.server.persistence.JdoUtils.toKeyValue; import java.io.Serializable; import javax.jdo.annotations.IdGeneratorStrategy; import javax.jdo.annotations.IdentityType; import javax.jdo.annotations.PersistenceCapable; import javax.jdo.annotations.Persistent; import javax.jdo.annotations.PrimaryKey; import org.dodgybits.shuffle.web.client.model.ContextValue; import org.dodgybits.shuffle.web.client.model.KeyValue; import org.dodgybits.shuffle.web.client.model.ContextValue.Builder; import com.google.appengine.api.datastore.Key; import com.google.appengine.api.users.User; @SuppressWarnings("serial") @PersistenceCapable(identityType = IdentityType.APPLICATION) public class Context implements Serializable { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Key mKey; @Persistent private User mUser; @Persistent private String mName; public final Key getKey() { return mKey; } public final User getUser() { return mUser; } public final String getName() { return mName; } public final ContextValue toContextValue() { KeyValue<ContextValue> keyValue = toKeyValue(mKey); Builder builder = new Builder(); builder.setId(keyValue) .setName(mName); return builder.build(); } public static final Context fromContextValue(User user, ContextValue value) { Context context = new Context(); context.mKey = toKey(value.getId()); context.mName = value.getName(); context.mUser = user; return context; } }
115371172-shuffle
server/src/org/dodgybits/shuffle/web/server/model/Context.java
Java
asf20
1,746
package org.dodgybits.shuffle.web.server.persistence; import java.util.ArrayList; import java.util.List; import javax.jdo.JDOHelper; import javax.jdo.PersistenceManager; import javax.jdo.PersistenceManagerFactory; import org.dodgybits.shuffle.web.client.model.KeyValue; import com.google.appengine.api.datastore.Key; import com.google.appengine.api.datastore.KeyFactory; public class JdoUtils { private static PersistenceManagerFactory pmf = JDOHelper.getPersistenceManagerFactory("transactions-optional"); private static ThreadLocal<PersistenceManager> threadLocalPm = new ThreadLocal<PersistenceManager>(); public static PersistenceManager getPm() { PersistenceManager pm = threadLocalPm.get(); if (pm == null) { pm = pmf.getPersistenceManager(); threadLocalPm.set(pm); } return pm; } public static void closePm() { PersistenceManager pm = threadLocalPm.get(); if (pm == null) { return; } if (!pm.isClosed()) { pm.close(); } threadLocalPm.set(null); } public static <V> KeyValue<V> toKeyValue(Key key) { KeyValue<V> keyValue = null; if (key != null) { keyValue = new KeyValue<V>(KeyFactory.keyToString(key)); } return keyValue; } public static <V> ArrayList<KeyValue<V>> toKeyValues(List<Key> keys) { ArrayList<KeyValue<V>> keyValues = new ArrayList<KeyValue<V>>(); for (Key key : keys) { KeyValue<V> keyValue = toKeyValue(key); keyValues.add(keyValue); } return keyValues; } public static Key toKey(KeyValue<?> keyValue) { Key key = null; if (keyValue != null) { key = KeyFactory.stringToKey(keyValue.getValue()); } return key; } public static <T> List<Key> toKeys(ArrayList<KeyValue<T>> keyValues) { List<Key> keys = new ArrayList<Key>(); if (keyValues != null) { for (KeyValue<?> keyValue : keyValues) { keys.add(toKey(keyValue)); } } return keys; } }
115371172-shuffle
server/src/org/dodgybits/shuffle/web/server/persistence/JdoUtils.java
Java
asf20
2,158
package org.dodgybits.shuffle.web.server.persistence; import javax.servlet.*; import java.io.IOException; /** * Ensures we properly release persistence resources even in * the face of exceptions. */ public class PersistenceFilter implements javax.servlet.Filter { public void destroy() { } public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws ServletException, IOException { try { chain.doFilter(req, resp); } finally { JdoUtils.closePm(); } } public void init(FilterConfig config) throws ServletException { } }
115371172-shuffle
server/src/org/dodgybits/shuffle/web/server/persistence/PersistenceFilter.java
Java
asf20
622
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <!-- The HTML 4.01 Transitional DOCTYPE declaration--> <!-- above set at the top of the file will set --> <!-- the browser's rendering engine into --> <!-- "Quirks Mode". Replacing this declaration --> <!-- with a "Standards Mode" doctype is supported, --> <!-- but may lead to some differences in layout. --> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Shuffle</title> <!-- --> <!-- This script loads your compiled module. --> <!-- If you add any GWT meta tags, they must --> <!-- be added before this line. --> <!-- --> <script type="text/javascript" language="javascript" src="shuffle/shuffle.nocache.js"></script> </head> <body> <noscript> <div style="width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color:white; border: 1px solid red; padding: 4px; font-family: sans-serif"> Your web browser must have JavaScript enabled in order for this application to display correctly. </div> </noscript> </body> </html>
115371172-shuffle
server/war/Shuffle.html
HTML
asf20
1,267
// // iCarousel.h // // Version 1.6.3 beta // // Created by Nick Lockwood on 01/04/2011. // Copyright 2010 Charcoal Design // // Distributed under the permissive zlib License // Get the latest version from either of these locations: // // http://charcoaldesign.co.uk/source/cocoa#icarousel // https://github.com/nicklockwood/iCarousel // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it // freely, subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; you must not // claim that you wrote the original software. If you use this software // in a product, an acknowledgment in the product documentation would be // appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, and must not be // misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // // // ARC Helper // // Version 1.3 // // Created by Nick Lockwood on 05/01/2012. // Copyright 2012 Charcoal Design // // Distributed under the permissive zlib license // Get the latest version from here: // // https://gist.github.com/1563325 // #ifndef AH_RETAIN #if __has_feature(objc_arc) #define AH_RETAIN(x) (x) #define AH_RELEASE(x) (void)(x) #define AH_AUTORELEASE(x) (x) #define AH_SUPER_DEALLOC (void)(0) #define __AH_BRIDGE __bridge #else #define __AH_WEAK #define AH_WEAK assign #define AH_RETAIN(x) [(x) retain] #define AH_RELEASE(x) [(x) release] #define AH_AUTORELEASE(x) [(x) autorelease] #define AH_SUPER_DEALLOC [super dealloc] #define __AH_BRIDGE #endif #endif // Weak reference support #ifndef AH_WEAK #if defined __IPHONE_OS_VERSION_MIN_REQUIRED #if __IPHONE_OS_VERSION_MIN_REQUIRED > __IPHONE_4_3 #define __AH_WEAK __weak #define AH_WEAK weak #else #define __AH_WEAK __unsafe_unretained #define AH_WEAK unsafe_unretained #endif #elif defined __MAC_OS_X_VERSION_MIN_REQUIRED #if __MAC_OS_X_VERSION_MIN_REQUIRED > __MAC_10_6 #define __AH_WEAK __weak #define AH_WEAK weak #else #define __AH_WEAK __unsafe_unretained #define AH_WEAK unsafe_unretained #endif #endif #endif // ARC Helper ends #import <Availability.h> #ifdef USING_CHAMELEON #define ICAROUSEL_IOS #elif defined __IPHONE_OS_VERSION_MAX_ALLOWED #define ICAROUSEL_IOS typedef CGRect NSRect; typedef CGSize NSSize; #else #define ICAROUSEL_MACOS #endif #import <QuartzCore/QuartzCore.h> #ifdef ICAROUSEL_IOS #import <UIKit/UIKit.h> #else #import <Cocoa/Cocoa.h> typedef NSView UIView; #endif typedef enum { iCarouselTypeLinear = 0, iCarouselTypeRotary, iCarouselTypeInvertedRotary, iCarouselTypeCylinder, iCarouselTypeInvertedCylinder, iCarouselTypeWheel, iCarouselTypeInvertedWheel, iCarouselTypeCoverFlow, iCarouselTypeCoverFlow2, iCarouselTypeTimeMachine, iCarouselTypeInvertedTimeMachine, iCarouselTypeCustom } iCarouselType; typedef enum { iCarouselTranformOptionCount = 0, iCarouselTranformOptionArc, iCarouselTranformOptionAngle, iCarouselTranformOptionRadius, iCarouselTranformOptionTilt, iCarouselTranformOptionSpacing } iCarouselTranformOption; @protocol iCarouselDataSource, iCarouselDelegate; @interface iCarousel : UIView //required for 32-bit Macs #ifdef __i386__ { @private id<iCarouselDelegate> __AH_WEAK delegate; id<iCarouselDataSource> __AH_WEAK dataSource; iCarouselType type; CGFloat perspective; NSInteger numberOfItems; NSInteger numberOfPlaceholders; NSInteger numberOfPlaceholdersToShow; NSInteger numberOfVisibleItems; UIView *contentView; NSDictionary *itemViews; NSMutableSet *itemViewPool; NSMutableSet *placeholderViewPool; NSInteger previousItemIndex; CGFloat itemWidth; CGFloat scrollOffset; CGFloat offsetMultiplier; CGFloat startVelocity; id __unsafe_unretained timer; BOOL decelerating; BOOL scrollEnabled; CGFloat decelerationRate; BOOL bounces; CGSize contentOffset; CGSize viewpointOffset; CGFloat startOffset; CGFloat endOffset; NSTimeInterval scrollDuration; NSTimeInterval startTime; BOOL scrolling; CGFloat previousTranslation; BOOL centerItemWhenSelected; BOOL shouldWrap; BOOL dragging; BOOL didDrag; CGFloat scrollSpeed; CGFloat bounceDistance; NSTimeInterval toggleTime; CGFloat toggle; BOOL stopAtItemBoundary; BOOL scrollToItemBoundary; BOOL useDisplayLink; BOOL vertical; BOOL ignorePerpendicularSwipes; NSInteger animationDisableCount; } #endif @property (nonatomic, AH_WEAK) IBOutlet id<iCarouselDataSource> dataSource; @property (nonatomic, AH_WEAK) IBOutlet id<iCarouselDelegate> delegate; @property (nonatomic, assign) iCarouselType type; @property (nonatomic, assign) CGFloat perspective; @property (nonatomic, assign) CGFloat decelerationRate; @property (nonatomic, assign) CGFloat scrollSpeed; @property (nonatomic, assign) CGFloat bounceDistance; @property (nonatomic, assign) BOOL scrollEnabled; @property (nonatomic, assign) BOOL bounces; @property (nonatomic, readonly) CGFloat scrollOffset; @property (nonatomic, readonly) CGFloat offsetMultiplier; @property (nonatomic, assign) CGSize contentOffset; @property (nonatomic, assign) CGSize viewpointOffset; @property (nonatomic, readonly) NSInteger numberOfItems; @property (nonatomic, readonly) NSInteger numberOfPlaceholders; @property (nonatomic, readonly) NSInteger currentItemIndex; @property (nonatomic, strong, readonly) UIView *currentItemView; @property (nonatomic, strong, readonly) NSArray *indexesForVisibleItems; @property (nonatomic, readonly) NSInteger numberOfVisibleItems; @property (nonatomic, strong, readonly) NSArray *visibleItemViews; @property (nonatomic, readonly) CGFloat itemWidth; @property (nonatomic, strong, readonly) UIView *contentView; @property (nonatomic, readonly) CGFloat toggle; @property (nonatomic, assign) BOOL stopAtItemBoundary; @property (nonatomic, assign) BOOL scrollToItemBoundary; @property (nonatomic, assign) BOOL useDisplayLink; @property (nonatomic, assign, getter = isVertical) BOOL vertical; @property (nonatomic, assign) BOOL ignorePerpendicularSwipes; - (void)scrollByNumberOfItems:(NSInteger)itemCount duration:(NSTimeInterval)duration; - (void)scrollToItemAtIndex:(NSInteger)index duration:(NSTimeInterval)duration; - (void)scrollToItemAtIndex:(NSInteger)index animated:(BOOL)animated; - (void)removeItemAtIndex:(NSInteger)index animated:(BOOL)animated; - (void)insertItemAtIndex:(NSInteger)index animated:(BOOL)animated; - (void)reloadItemAtIndex:(NSInteger)index animated:(BOOL)animated; - (UIView *)itemViewAtIndex:(NSInteger)index; - (NSInteger)indexOfItemView:(UIView *)view; - (NSInteger)indexOfItemViewOrSubview:(UIView *)view; - (CGFloat)offsetForItemAtIndex:(NSInteger)index; - (void)reloadData; #ifdef ICAROUSEL_IOS @property (nonatomic, assign) BOOL centerItemWhenSelected; #endif @end @protocol iCarouselDataSource <NSObject> - (NSUInteger)numberOfItemsInCarousel:(iCarousel *)carousel; - (UIView *)carousel:(iCarousel *)carousel viewForItemAtIndex:(NSUInteger)index reusingView:(UIView *)view; @optional - (NSUInteger)numberOfPlaceholdersInCarousel:(iCarousel *)carousel; - (UIView *)carousel:(iCarousel *)carousel placeholderViewAtIndex:(NSUInteger)index reusingView:(UIView *)view; - (NSUInteger)numberOfVisibleItemsInCarousel:(iCarousel *)carousel; //deprecated, use carousel:viewForItemAtIndex:reusingView: and carousel:placeholderViewAtIndex:reusingView: instead - (UIView *)carousel:(iCarousel *)carousel viewForItemAtIndex:(NSUInteger)index __deprecated; - (UIView *)carousel:(iCarousel *)carousel placeholderViewAtIndex:(NSUInteger)index __deprecated; @end @protocol iCarouselDelegate <NSObject> @optional - (void)carouselWillBeginScrollingAnimation:(iCarousel *)carousel; - (void)carouselDidEndScrollingAnimation:(iCarousel *)carousel; - (void)carouselDidScroll:(iCarousel *)carousel; - (void)carouselCurrentItemIndexUpdated:(iCarousel *)carousel; - (void)carouselWillBeginDragging:(iCarousel *)carousel; - (void)carouselDidEndDragging:(iCarousel *)carousel willDecelerate:(BOOL)decelerate; - (void)carouselWillBeginDecelerating:(iCarousel *)carousel; - (void)carouselDidEndDecelerating:(iCarousel *)carousel; - (CGFloat)carouselItemWidth:(iCarousel *)carousel; - (CGFloat)carouselOffsetMultiplier:(iCarousel *)carousel; - (BOOL)carouselShouldWrap:(iCarousel *)carousel; - (CGFloat)carousel:(iCarousel *)carousel itemAlphaForOffset:(CGFloat)offset; - (CATransform3D)carousel:(iCarousel *)carousel itemTransformForOffset:(CGFloat)offset baseTransform:(CATransform3D)transform; - (CGFloat)carousel:(iCarousel *)carousel valueForTransformOption:(iCarouselTranformOption)option withDefault:(CGFloat)value; //deprecated, use transformForItemAtIndex:withOffset:baseTransform: instead - (CATransform3D)carousel:(iCarousel *)carousel transformForItemView:(UIView *)view withOffset:(CGFloat)offset __deprecated; #ifdef ICAROUSEL_IOS - (BOOL)carousel:(iCarousel *)carousel shouldSelectItemAtIndex:(NSInteger)index; - (void)carousel:(iCarousel *)carousel didSelectItemAtIndex:(NSInteger)index; #endif @end
009-20120511-z
trunk/Zinipad/Zinipad/iCarousel.h
Objective-C
gpl3
9,459
// // AppDelegate.h // Zinipad // // Created by Kamain on 12. 5. 17.. // Copyright (c) 2012년 __MyCompanyName__. All rights reserved. // #import <UIKit/UIKit.h> @interface AppDelegate : UIResponder <UIApplicationDelegate> { UINavigationController* _aNavigationContoller; } @property (strong, nonatomic) UIWindow *window; @property (nonatomic, retain) UINavigationController* _aNavigationController; @end
009-20120511-z
trunk/Zinipad/Zinipad/AppDelegate.h
Objective-C
gpl3
418
// // iCarousel.m // // Version 1.6.3 beta // // Created by Nick Lockwood on 01/04/2011. // Copyright 2010 Charcoal Design // // Distributed under the permissive zlib License // Get the latest version from either of these locations: // // http://charcoaldesign.co.uk/source/cocoa#icarousel // https://github.com/nicklockwood/iCarousel // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it // freely, subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; you must not // claim that you wrote the original software. If you use this software // in a product, an acknowledgment in the product documentation would be // appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, and must not be // misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // #import "iCarousel.h" #define MIN_TOGGLE_DURATION 0.2f #define MAX_TOGGLE_DURATION 0.4f #define SCROLL_DURATION 0.4f #define INSERT_DURATION 0.4f #define DECELERATE_THRESHOLD 0.1f #define SCROLL_SPEED_THRESHOLD 2.0f #define SCROLL_DISTANCE_THRESHOLD 0.1f #define DECELERATION_MULTIPLIER 30.0f #define DEFAULT_FAN_COUNT 10 @interface iCarousel () @property (nonatomic, strong) UIView *contentView; @property (nonatomic, strong) NSDictionary *itemViews; @property (nonatomic, strong) NSMutableSet *itemViewPool; @property (nonatomic, strong) NSMutableSet *placeholderViewPool; @property (nonatomic, assign) NSInteger previousItemIndex; @property (nonatomic, assign) NSInteger numberOfPlaceholdersToShow; @property (nonatomic, assign) NSInteger numberOfVisibleItems; @property (nonatomic, assign) CGFloat itemWidth; @property (nonatomic, assign) CGFloat scrollOffset; @property (nonatomic, assign) CGFloat offsetMultiplier; @property (nonatomic, assign) CGFloat startOffset; @property (nonatomic, assign) CGFloat endOffset; @property (nonatomic, assign) NSTimeInterval scrollDuration; @property (nonatomic, assign) BOOL scrolling; @property (nonatomic, assign) NSTimeInterval startTime; @property (nonatomic, assign) CGFloat startVelocity; @property (nonatomic, unsafe_unretained) id timer; @property (nonatomic, assign) BOOL decelerating; @property (nonatomic, assign) CGFloat previousTranslation; @property (nonatomic, assign) BOOL shouldWrap; @property (nonatomic, assign) BOOL dragging; @property (nonatomic, assign) BOOL didDrag; @property (nonatomic, assign) NSTimeInterval toggleTime; @property (nonatomic, assign) NSInteger animationDisableCount; NSComparisonResult compareViewDepth(UIView *view1, UIView *view2, iCarousel *self); - (void)step; - (void)didMoveToSuperview; - (void)layOutItemViews; - (UIView *)loadViewAtIndex:(NSInteger)index; - (NSInteger)clampedIndex:(NSInteger)index; - (CGFloat)clampedOffset:(CGFloat)offset; - (void)transformItemView:(UIView *)view atIndex:(NSInteger)index; - (void)startAnimation; - (void)stopAnimation; - (void)enableAnimation; - (void)disableAnimation; - (void)didScroll; @end @implementation iCarousel @synthesize dataSource; @synthesize delegate; @synthesize type; @synthesize perspective; @synthesize numberOfItems; @synthesize numberOfPlaceholders; @synthesize numberOfPlaceholdersToShow; @synthesize numberOfVisibleItems; @synthesize contentView; @synthesize itemViews; @synthesize itemViewPool; @synthesize placeholderViewPool; @synthesize previousItemIndex; @synthesize itemWidth; @synthesize scrollOffset; @synthesize offsetMultiplier; @synthesize startVelocity; @synthesize timer; @synthesize decelerating; @synthesize scrollEnabled; @synthesize decelerationRate; @synthesize bounceDistance; @synthesize bounces; @synthesize contentOffset; @synthesize viewpointOffset; @synthesize startOffset; @synthesize endOffset; @synthesize scrollDuration; @synthesize startTime; @synthesize scrolling; @synthesize previousTranslation; @synthesize shouldWrap; @synthesize vertical; @synthesize dragging; @synthesize didDrag; @synthesize scrollSpeed; @synthesize toggleTime; @synthesize toggle; @synthesize stopAtItemBoundary; @synthesize scrollToItemBoundary; @synthesize useDisplayLink; @synthesize ignorePerpendicularSwipes; @synthesize animationDisableCount; #ifdef ICAROUSEL_IOS @synthesize centerItemWhenSelected; #else CVReturn displayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeStamp *inNow, const CVTimeStamp *inOutputTime, CVOptionFlags flagsIn, CVOptionFlags *flagsOut, iCarousel *self) { [self performSelectorOnMainThread:@selector(step) withObject:nil waitUntilDone:NO]; return kCVReturnSuccess; } #endif #pragma mark - #pragma mark Initialisation - (void)setUp { type = iCarouselTypeLinear; perspective = -1.0f/500.0f; decelerationRate = 0.95f; scrollEnabled = YES; bounces = YES; scrollOffset = 0.0f; offsetMultiplier = 1.0f; contentOffset = CGSizeZero; viewpointOffset = CGSizeZero; shouldWrap = NO; scrollSpeed = 1.0f; bounceDistance = 1.0f; toggle = 0.0f; stopAtItemBoundary = YES; scrollToItemBoundary = YES; useDisplayLink = YES; ignorePerpendicularSwipes = YES; contentView = [[UIView alloc] initWithFrame:self.bounds]; #ifdef ICAROUSEL_IOS centerItemWhenSelected = YES; UIPanGestureRecognizer *panGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(didPan:)]; panGesture.delegate = (id <UIGestureRecognizerDelegate>)self; [contentView addGestureRecognizer:panGesture]; AH_RELEASE(panGesture); #else [contentView setWantsLayer:YES]; #endif [self addSubview:contentView]; [self reloadData]; } #ifndef USING_CHAMELEON - (id)initWithCoder:(NSCoder *)aDecoder { if ((self = [super initWithCoder:aDecoder])) { [self setUp]; [self didMoveToSuperview]; } return self; } #endif - (id)initWithFrame:(NSRect)frame { if ((self = [super initWithFrame:frame])) { [self setUp]; } return self; } - (void)dealloc { [self stopAnimation]; AH_RELEASE(contentView); AH_RELEASE(itemViews); AH_RELEASE(itemViewPool); AH_RELEASE(placeholderViewPool); AH_SUPER_DEALLOC; } - (void)setDataSource:(id<iCarouselDataSource>)_dataSource { if (dataSource != _dataSource) { dataSource = _dataSource; if (dataSource) { [self reloadData]; } } } - (void)setDelegate:(id<iCarouselDelegate>)_delegate { if (delegate != _delegate) { delegate = _delegate; if (delegate && dataSource) { [self layOutItemViews]; } } } - (void)setType:(iCarouselType)_type { if (type != _type) { type = _type; [self layOutItemViews]; } } - (void)setVertical:(BOOL)_vertical { if (vertical != _vertical) { vertical = _vertical; [self layOutItemViews]; } } - (void)setNumberOfVisibleItems:(NSInteger)_numberOfVisibleItems { if (numberOfVisibleItems != _numberOfVisibleItems) { numberOfVisibleItems = _numberOfVisibleItems; [self layOutItemViews]; } } - (void)setContentOffset:(CGSize)_contentOffset { if (!CGSizeEqualToSize(contentOffset, _contentOffset)) { contentOffset = _contentOffset; [self layOutItemViews]; } } - (void)setViewpointOffset:(CGSize)_viewpointOffset { if (!CGSizeEqualToSize(viewpointOffset, _viewpointOffset)) { viewpointOffset = _viewpointOffset; [self layOutItemViews]; } } - (void)setUseDisplayLinkIfAvailable:(BOOL)_useDisplayLink { if (useDisplayLink != _useDisplayLink) { useDisplayLink = _useDisplayLink; if (timer) { [self stopAnimation]; [self startAnimation]; } } } - (void)enableAnimation { animationDisableCount --; if (animationDisableCount == 0) { [CATransaction setDisableActions:NO]; } } - (void)disableAnimation { animationDisableCount ++; if (animationDisableCount == 1) { [CATransaction setDisableActions:YES]; } } #pragma mark - #pragma mark View management - (NSArray *)indexesForVisibleItems { return [[itemViews allKeys] sortedArrayUsingSelector:@selector(compare:)]; } - (NSArray *)visibleItemViews { NSArray *indexes = [self indexesForVisibleItems]; return [itemViews objectsForKeys:indexes notFoundMarker:[NSNull null]]; } - (UIView *)itemViewAtIndex:(NSInteger)index { return [itemViews objectForKey:[NSNumber numberWithInteger:index]]; } - (UIView *)currentItemView { return [self itemViewAtIndex:self.currentItemIndex]; } - (NSInteger)indexOfItemView:(UIView *)view { NSInteger index = [[itemViews allValues] indexOfObject:view]; if (index != NSNotFound) { return [[[itemViews allKeys] objectAtIndex:index] integerValue]; } return NSNotFound; } - (NSInteger)indexOfItemViewOrSubview:(UIView *)view { NSInteger index = [self indexOfItemView:view]; if (index == NSNotFound && view != nil && view != contentView) { return [self indexOfItemViewOrSubview:view.superview]; } return index; } - (void)setItemView:(UIView *)view forIndex:(NSInteger)index { [(NSMutableDictionary *)itemViews setObject:view forKey:[NSNumber numberWithInteger:index]]; } - (void)removeViewAtIndex:(NSInteger)index { NSMutableDictionary *newItemViews = [NSMutableDictionary dictionaryWithCapacity:[itemViews count] - 1]; for (NSNumber *number in [self indexesForVisibleItems]) { NSInteger i = [number integerValue]; if (i < index) { [newItemViews setObject:[itemViews objectForKey:number] forKey:number]; } else if (i > index) { [newItemViews setObject:[itemViews objectForKey:number] forKey:[NSNumber numberWithInteger:i - 1]]; } } self.itemViews = newItemViews; } - (void)insertView:(UIView *)view atIndex:(NSInteger)index { NSMutableDictionary *newItemViews = [NSMutableDictionary dictionaryWithCapacity:[itemViews count] + 1]; for (NSNumber *number in [self indexesForVisibleItems]) { NSInteger i = [number integerValue]; if (i < index) { [newItemViews setObject:[itemViews objectForKey:number] forKey:number]; } else { [newItemViews setObject:[itemViews objectForKey:number] forKey:[NSNumber numberWithInteger:i + 1]]; } } if (view) { [self setItemView:view forIndex:index]; } self.itemViews = newItemViews; } #pragma mark - #pragma mark View layout - (CGFloat)alphaForItemWithOffset:(CGFloat)offset { switch (type) { case iCarouselTypeTimeMachine: case iCarouselTypeInvertedTimeMachine: { if (type == iCarouselTypeInvertedTimeMachine) { offset = -offset; } #ifdef ICAROUSEL_MACOS if (vertical) { //invert again offset = -offset; } #endif return 1.0f - fminf(fmaxf(offset, 0.0f), 1.0f); } case iCarouselTypeCustom: { if ([delegate respondsToSelector:@selector(carousel:itemAlphaForOffset:)]) { return [delegate carousel:self itemAlphaForOffset:offset]; } //else, fall through to default } default: { return 1.0f; } } } - (CGFloat)valueForTransformOption:(iCarouselTranformOption)option withDefault:(CGFloat)value { if ([delegate respondsToSelector:@selector(carousel:valueForTransformOption:withDefault:)]) { return [delegate carousel:self valueForTransformOption:option withDefault:value]; } return value; } - (CATransform3D)transformForItemView:(UIView *)view withOffset:(CGFloat)offset { //set up base transform CATransform3D transform = CATransform3DIdentity; transform.m34 = perspective; transform = CATransform3DTranslate(transform, -viewpointOffset.width, -viewpointOffset.height, 0.0f); //perform transform switch (type) { case iCarouselTypeCustom: { if ([delegate respondsToSelector:@selector(carousel:itemTransformForOffset:baseTransform:)]) { return [delegate carousel:self itemTransformForOffset:offset baseTransform:transform]; } //deprecated code path else if ([delegate respondsToSelector:@selector(carousel:transformForItemView:withOffset:)]) { NSLog(@"Delegate method carousel:transformForItemView:withOffset: is deprecated, use carousel:transformForItemAtIndex:withOffset:baseTransform: instead."); return [delegate carousel:self transformForItemView:view withOffset:offset]; } //else, fall through to linear transform } case iCarouselTypeLinear: { if (vertical) { return CATransform3DTranslate(transform, 0.0f, offset * itemWidth, 0.0f); } else { return CATransform3DTranslate(transform, offset * itemWidth, 0.0f, 0.0f); } } case iCarouselTypeRotary: case iCarouselTypeInvertedRotary: { NSInteger count = [self valueForTransformOption:iCarouselTranformOptionCount withDefault: MIN(numberOfVisibleItems, numberOfItems + numberOfPlaceholdersToShow)]; CGFloat arc = [self valueForTransformOption:iCarouselTranformOptionArc withDefault:M_PI * 2.0f]; CGFloat radius = [self valueForTransformOption:iCarouselTranformOptionRadius withDefault:fmaxf(itemWidth / 2.0f, itemWidth / 2.0f / tanf(arc/2.0f/count))]; CGFloat angle = [self valueForTransformOption:iCarouselTranformOptionAngle withDefault:offset / count * arc]; if (type == iCarouselTypeInvertedRotary) { radius = -radius; angle = -angle; } if (vertical) { return CATransform3DTranslate(transform, 0.0f, radius * sin(angle), radius * cos(angle) - radius); } else { return CATransform3DTranslate(transform, radius * sin(angle), 0.0f, radius * cos(angle) - radius); } } case iCarouselTypeCylinder: case iCarouselTypeInvertedCylinder: { NSInteger count = [self valueForTransformOption:iCarouselTranformOptionCount withDefault: MIN(numberOfVisibleItems, numberOfItems + numberOfPlaceholdersToShow)]; CGFloat arc = [self valueForTransformOption:iCarouselTranformOptionArc withDefault:M_PI * 2.0f]; CGFloat radius = [self valueForTransformOption:iCarouselTranformOptionRadius withDefault:fmaxf(0.01f, itemWidth / 2.0f / tanf(arc/2.0f/count))]; CGFloat angle = [self valueForTransformOption:iCarouselTranformOptionAngle withDefault:offset / count * arc]; if (type == iCarouselTypeInvertedCylinder) { radius = -radius; angle = -angle; } if (vertical) { transform = CATransform3DTranslate(transform, 0.0f, 0.0f, -radius); transform = CATransform3DRotate(transform, angle, -1.0f, 0.0f, 0.0f); return CATransform3DTranslate(transform, 0.0f, 0.0f, radius + 0.01f); } else { transform = CATransform3DTranslate(transform, 0.0f, 0.0f, -radius); transform = CATransform3DRotate(transform, angle, 0.0f, 1.0f, 0.0f); return CATransform3DTranslate(transform, 0.0f, 0.0f, radius + 0.01f); } } case iCarouselTypeWheel: case iCarouselTypeInvertedWheel: { NSInteger count = [self valueForTransformOption:iCarouselTranformOptionCount withDefault: MIN(numberOfVisibleItems, numberOfItems + numberOfPlaceholdersToShow)]; CGFloat arc = [self valueForTransformOption:iCarouselTranformOptionArc withDefault:M_PI * 2.0f]; CGFloat radius = [self valueForTransformOption:iCarouselTranformOptionRadius withDefault:itemWidth * (CGFloat)count / arc]; CGFloat angle = [self valueForTransformOption:iCarouselTranformOptionAngle withDefault:arc / (CGFloat)count]; if (type == iCarouselTypeInvertedWheel) { radius = -radius; angle = -angle; } if (vertical) { transform = CATransform3DTranslate(transform, -radius, 0.0f, 0.0f); transform = CATransform3DRotate(transform, angle * offset, 0.0f, 0.0f, 1.0f); return CATransform3DTranslate(transform, radius, 0.0f, offset * 0.01f); } else { transform = CATransform3DTranslate(transform, 0.0f, radius, 0.0f); transform = CATransform3DRotate(transform, angle * offset, 0.0f, 0.0f, 1.0f); return CATransform3DTranslate(transform, 0.0f, -radius, offset * 0.01f); } } case iCarouselTypeCoverFlow: case iCarouselTypeCoverFlow2: { CGFloat tilt = [self valueForTransformOption:iCarouselTranformOptionTilt withDefault:0.9f]; CGFloat spacing = [self valueForTransformOption:iCarouselTranformOptionSpacing withDefault:0.25f]; // should be ~ 1/scrollSpeed; CGFloat clampedOffset = fmaxf(-1.0f, fminf(1.0f, offset)); if (type == iCarouselTypeCoverFlow2) { if (toggle >= 0.0f) { if (offset <= -0.5f) { clampedOffset = -1.0f; } else if (offset <= 0.5f) { clampedOffset = -toggle; } else if (offset <= 1.5f) { clampedOffset = 1.0f - toggle; } } else { if (offset > 0.5f) { clampedOffset = 1.0f; } else if (offset > -0.5f) { clampedOffset = -toggle; } else if (offset > -1.5f) { clampedOffset = - 1.0f - toggle; } } } CGFloat x = (clampedOffset * 0.5f * tilt + offset * spacing) * itemWidth; CGFloat z = fabsf(clampedOffset) * -itemWidth * 0.5f; if (vertical) { transform = CATransform3DTranslate(transform, 0.0f, x, z); return CATransform3DRotate(transform, -clampedOffset * M_PI_2 * tilt, -1.0f, 0.0f, 0.0f); } else { transform = CATransform3DTranslate(transform, x, 0.0f, z); return CATransform3DRotate(transform, -clampedOffset * M_PI_2 * tilt, 0.0f, 1.0f, 0.0f); } } case iCarouselTypeTimeMachine: case iCarouselTypeInvertedTimeMachine: { CGFloat tilt = [self valueForTransformOption:iCarouselTranformOptionTilt withDefault:0.3f]; CGFloat spacing = [self valueForTransformOption:iCarouselTranformOptionSpacing withDefault:1.0f]; if (type == iCarouselTypeInvertedTimeMachine) { tilt = -tilt; offset = -offset; } if (vertical) { #ifdef ICAROUSEL_MACOS //invert again tilt = -tilt; offset = -offset; #endif return CATransform3DTranslate(transform, 0.0f, offset * itemWidth * tilt, offset * itemWidth * spacing); } else { return CATransform3DTranslate(transform, offset * itemWidth * tilt, 0.0f, offset * itemWidth * spacing); } } default: { //shouldn't ever happen return CATransform3DIdentity; } } } #ifdef ICAROUSEL_IOS NSComparisonResult compareViewDepth(UIView *view1, UIView *view2, iCarousel *self) { CATransform3D t1 = view1.superview.layer.transform; CATransform3D t2 = view2.superview.layer.transform; CGFloat z1 = t1.m13 + t1.m23 + t1.m33 + t1.m43; CGFloat z2 = t2.m13 + t2.m23 + t2.m33 + t2.m43; CGFloat difference = z1 - z2; if (difference == 0.0f) { CATransform3D t3 = [self currentItemView].superview.layer.transform; CGFloat x1 = t1.m11 + t1.m21 + t1.m31 + t1.m41; CGFloat x2 = t2.m11 + t2.m21 + t2.m31 + t2.m41; CGFloat x3 = t3.m11 + t3.m21 + t3.m31 + t3.m41; difference = fabsf(x2 - x3) - fabsf(x1 - x3); } return (difference < 0.0f)? NSOrderedAscending: NSOrderedDescending; } - (void)depthSortViews { for (UIView *view in [[itemViews allValues] sortedArrayUsingFunction:(NSInteger (*)(id, id, void *))compareViewDepth context:(__AH_BRIDGE void *)self]) { [contentView addSubview:view.superview]; } } #else - (void)depthSortViews { //does nothing on Mac OS } #endif - (CGFloat)offsetForItemAtIndex:(NSInteger)index { //calculate relative position CGFloat itemOffset = itemWidth? (scrollOffset / itemWidth): 0.0f; CGFloat offset = index - itemOffset; if (shouldWrap) { if (offset > numberOfItems/2) { offset -= numberOfItems; } else if (offset < -numberOfItems/2) { offset += numberOfItems; } } //handle special case for one item if (numberOfItems + numberOfPlaceholdersToShow == 1) { offset = 0.0f; } #ifdef ICAROUSEL_MACOS if (vertical) { //invert transform offset = -offset; } #endif return offset; } - (UIView *)containView:(UIView *)view { UIView *container = AH_AUTORELEASE([[UIView alloc] initWithFrame:view.frame]); #ifdef ICAROUSEL_IOS //add tap gesture recogniser UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didTap:)]; tapGesture.delegate = (id <UIGestureRecognizerDelegate>)self; [container addGestureRecognizer:tapGesture]; AH_RELEASE(tapGesture); #endif [container addSubview:view]; return container; } - (void)transformItemView:(UIView *)view atIndex:(NSInteger)index { view.superview.bounds = view.bounds; //calculate offset CGFloat offset = [self offsetForItemAtIndex:index]; #ifdef ICAROUSEL_IOS //////////////////////////////////////////////////// // 위치 잡기 ////////////////////////////////////////////////////// //center view view.center = CGPointMake(view.bounds.size.width/2.0f, view.bounds.size.height/2.0f); view.superview.center = CGPointMake(self.bounds.size.width/2.0f + contentOffset.width, self.bounds.size.height/2.0f + contentOffset.height); //update alpha view.superview.alpha = [self alphaForItemWithOffset:offset]; #else //center view [view setFrameOrigin:NSMakePoint(0.0f, 0.0f)]; [view.superview setFrameOrigin:NSMakePoint(self.bounds.size.width/2.0f + contentOffset.width, self.bounds.size.height/2.0f + contentOffset.height)]; view.superview.layer.anchorPoint = CGPointMake(0.5f, 0.5f); //update alpha [view.superview setAlphaValue:[self alphaForItemWithOffset:offset]]; #endif //update backface visibility view.superview.layer.doubleSided = view.layer.doubleSided; //special-case logic for iCarouselTypeCoverFlow2 CGFloat clampedOffset = fmaxf(-1.0f, fminf(1.0f, offset)); if (decelerating || (scrolling && !didDrag) || (scrollOffset - [self clampedOffset:scrollOffset]) != 0.0f) { if (offset > 0) { toggle = (offset <= 0.5f)? -clampedOffset: (1.0f - clampedOffset); } else { toggle = (offset > -0.5f)? -clampedOffset: (- 1.0f - clampedOffset); } } //calculate transform CATransform3D transform = [self transformForItemView:view withOffset:offset]; //transform view view.superview.layer.transform = transform; } //for iOS - (void)layoutSubviews { contentView.frame = self.bounds; [self layOutItemViews]; } //for Mac OS - (void)resizeSubviewsWithOldSize:(NSSize)oldSize { [self disableAnimation]; [self layoutSubviews]; [self enableAnimation]; } - (void)transformItemViews { for (NSNumber *number in itemViews) { NSInteger index = [number integerValue]; UIView *view = [itemViews objectForKey:number]; [self transformItemView:view atIndex:index]; #ifdef ICAROUSEL_IOS view.userInteractionEnabled = (!centerItemWhenSelected || index == self.currentItemIndex); #endif } } - (void)updateItemWidth { if ([delegate respondsToSelector:@selector(carouselItemWidth:)]) { itemWidth = [delegate carouselItemWidth:self]; } else if (numberOfItems > 0) { if ([itemViews count] == 0) { [self loadViewAtIndex:0]; } UIView *itemView = [[itemViews allValues] lastObject]; itemWidth = vertical? itemView.bounds.size.height: itemView.bounds.size.width; } else if (numberOfPlaceholders > 0) { if ([itemViews count] == 0) { [self loadViewAtIndex:-1]; } UIView *itemView = [[itemViews allValues] lastObject]; itemWidth = vertical? itemView.bounds.size.height: itemView.bounds.size.width; } } - (void)layOutItemViews { //bail out if not set up yet if (!dataSource || !contentView) { return; } //record current item width CGFloat prevItemWidth = itemWidth; //update wrap if ([delegate respondsToSelector:@selector(carouselShouldWrap:)]) { shouldWrap = [delegate carouselShouldWrap:self]; } else { switch (type) { case iCarouselTypeRotary: case iCarouselTypeInvertedRotary: case iCarouselTypeCylinder: case iCarouselTypeInvertedCylinder: case iCarouselTypeWheel: case iCarouselTypeInvertedWheel: { shouldWrap = YES; break; } default: { shouldWrap = NO; break; } } } //no placeholders on wrapped carousels numberOfPlaceholdersToShow = shouldWrap? 0: numberOfPlaceholders; //set item width [self updateItemWidth]; //update offset multiplier if ([delegate respondsToSelector:@selector(carouselOffsetMultiplier:)]) { offsetMultiplier = [delegate carouselOffsetMultiplier:self]; } else { switch (type) { case iCarouselTypeCoverFlow: case iCarouselTypeCoverFlow2: { offsetMultiplier = 2.0f; break; } default: { offsetMultiplier = 1.0f; break; } } } //adjust scroll offset if (prevItemWidth) { scrollOffset = itemWidth? (scrollOffset / prevItemWidth * itemWidth): 0.0f; } else { //prevent false index changed event previousItemIndex = self.currentItemIndex; } //align if (!scrolling && !decelerating) { if (scrollToItemBoundary) { [self scrollToItemAtIndex:self.currentItemIndex animated:YES]; } else { scrollOffset = [self clampedOffset:scrollOffset]; } } //update views [self didScroll]; } #pragma mark - #pragma mark View queing - (void)queueItemView:(UIView *)view { if (view) { [itemViewPool addObject:view]; } } - (void)queuePlaceholderView:(UIView *)view { if (view) { [placeholderViewPool addObject:view]; } } - (UIView *)dequeueItemView { UIView *view = AH_RETAIN([itemViewPool anyObject]); if (view) { [itemViewPool removeObject:view]; } return AH_AUTORELEASE(view); } - (UIView *)dequeuePlaceholderView { UIView *view = AH_RETAIN([placeholderViewPool anyObject]); if (view) { [placeholderViewPool removeObject:view]; } return AH_AUTORELEASE(view); } #pragma mark - #pragma mark View loading - (UIView *)loadViewAtIndex:(NSInteger)index withContainerView:(UIView *)containerView { [self disableAnimation]; UIView *view = nil; if (index < 0) { if ([dataSource respondsToSelector:@selector(carousel:placeholderViewAtIndex:reusingView:)]) { view = [dataSource carousel:self placeholderViewAtIndex:(int)ceilf((CGFloat)numberOfPlaceholdersToShow/2.0f) + index reusingView:[self dequeuePlaceholderView]]; } //deprecated code path else if ([dataSource respondsToSelector:@selector(carousel:placeholderViewAtIndex:)]) { NSLog(@"DataSource method carousel:placeholderViewAtIndex: is deprecated, use carousel:placeholderViewAtIndex:reusingView: instead."); view = [dataSource carousel:self placeholderViewAtIndex:(int)ceilf((CGFloat)numberOfPlaceholdersToShow/2.0f) + index]; } } else if (index >= numberOfItems) { if ([dataSource respondsToSelector:@selector(carousel:placeholderViewAtIndex:reusingView:)]) { view = [dataSource carousel:self placeholderViewAtIndex:numberOfPlaceholdersToShow/2.0f + index - numberOfItems reusingView:[self dequeuePlaceholderView]]; } //deprecated code path else if ([dataSource respondsToSelector:@selector(carousel:placeholderViewAtIndex:)]) { NSLog(@"DataSource method carousel:placeholderViewAtIndex: is deprecated, use carousel:placeholderViewAtIndex:reusingView: instead."); view = [dataSource carousel:self placeholderViewAtIndex:numberOfPlaceholdersToShow/2.0f + index - numberOfItems]; } } else if ([dataSource respondsToSelector:@selector(carousel:viewForItemAtIndex:reusingView:)]) { view = [dataSource carousel:self viewForItemAtIndex:index reusingView:[self dequeueItemView]]; } //deprecated code path else { NSLog(@"DataSource method carousel:viewForItemAtIndex: is deprecated, use carousel:viewForItemAtIndex:reusingView: instead."); view = [dataSource carousel:self viewForItemAtIndex:index]; } if (view == nil) { view = AH_AUTORELEASE([[UIView alloc] init]); } [self setItemView:view forIndex:index]; if (containerView) { UIView *oldItemView = [containerView.subviews lastObject]; if (index < 0 || index >= numberOfItems) { [self queuePlaceholderView:view]; } else { [self queueItemView:view]; } [oldItemView removeFromSuperview]; containerView.frame = view.frame; [containerView addSubview:view]; } else { [contentView addSubview:[self containView:view]]; } [self transformItemView:view atIndex:index]; [self enableAnimation]; return view; } - (UIView *)loadViewAtIndex:(NSInteger)index { return [self loadViewAtIndex:index withContainerView:nil]; } - (void)loadUnloadViews { //calculate visible view indices NSMutableSet *visibleIndices = [NSMutableSet setWithCapacity:numberOfVisibleItems]; NSInteger min = -(int)ceilf((CGFloat)numberOfPlaceholdersToShow/2.0f); NSInteger max = numberOfItems - 1 + numberOfPlaceholdersToShow/2; NSInteger count = MIN(numberOfVisibleItems, numberOfItems + numberOfPlaceholdersToShow); NSInteger offset = self.currentItemIndex - numberOfVisibleItems/2; if (!shouldWrap) { offset = MAX(min, MIN(max - count + 1, offset)); } for (NSInteger i = 0; i < count; i++) { NSInteger index = i + offset; if (shouldWrap) { index = [self clampedIndex:index]; } [visibleIndices addObject:[NSNumber numberWithInteger:index]]; } //remove offscreen views for (NSNumber *number in [itemViews allKeys]) { if (![visibleIndices containsObject:number]) { UIView *view = [itemViews objectForKey:number]; if ([number integerValue] < 0 || [number integerValue] >= numberOfItems) { [self queuePlaceholderView:view]; } else { [self queueItemView:view]; } [view.superview removeFromSuperview]; [(NSMutableDictionary *)itemViews removeObjectForKey:number]; } } //add onscreen views for (NSNumber *number in visibleIndices) { UIView *view = [itemViews objectForKey:number]; if (view == nil) { [self loadViewAtIndex:[number integerValue]]; } } } - (void)reloadData { //remove old views for (UIView *view in [self.itemViews allValues]) { [view.superview removeFromSuperview]; } //bail out if not set up yet if (!dataSource || !contentView) { return; } //get number of items and placeholders numberOfItems = [dataSource numberOfItemsInCarousel:self]; if ([dataSource respondsToSelector:@selector(numberOfPlaceholdersInCarousel:)]) { numberOfPlaceholders = [dataSource numberOfPlaceholdersInCarousel:self]; } //get number of visible items numberOfVisibleItems = numberOfItems + numberOfPlaceholders; if ([dataSource respondsToSelector:@selector(numberOfVisibleItemsInCarousel:)]) { numberOfVisibleItems = [dataSource numberOfVisibleItemsInCarousel:self]; } //reset view pools self.itemViews = [NSMutableDictionary dictionaryWithCapacity:numberOfVisibleItems]; self.itemViewPool = [NSMutableSet setWithCapacity:numberOfVisibleItems]; self.placeholderViewPool = [NSMutableSet setWithCapacity:numberOfVisibleItems]; //layout views [self disableAnimation]; [self layOutItemViews]; [self depthSortViews]; [self performSelector:@selector(depthSortViews) withObject:nil afterDelay:0.0f]; [self enableAnimation]; if (numberOfItems > 0 && scrollOffset < 0.0f) { [self scrollToItemAtIndex:0 animated:(numberOfPlaceholders > 0)]; } } #pragma mark - #pragma mark Scrolling - (NSInteger)clampedIndex:(NSInteger)index { if (shouldWrap) { if (numberOfItems == 0) { return 0; } return index - floorf((CGFloat)index / (CGFloat)numberOfItems) * numberOfItems; } else { return MIN(MAX(index, 0), numberOfItems - 1); } } - (CGFloat)clampedOffset:(CGFloat)offset { if (shouldWrap) { if (numberOfItems == 0) { return 0.0f; } CGFloat contentWidth = numberOfItems * itemWidth; CGFloat clampedOffset = contentWidth? (offset - floorf(offset / contentWidth) * contentWidth): 0.0f; return clampedOffset; } else { return fminf(fmaxf(0.0f, offset), numberOfItems * itemWidth - itemWidth); } } - (NSInteger)currentItemIndex { return itemWidth? [self clampedIndex:roundf(scrollOffset / itemWidth)]: 0.0f; } - (NSInteger)minScrollDistanceFromIndex:(NSInteger)fromIndex toIndex:(NSInteger)toIndex { NSInteger directDistance = toIndex - fromIndex; if (shouldWrap) { NSInteger wrappedDistance = MIN(toIndex, fromIndex) + numberOfItems - MAX(toIndex, fromIndex); if (fromIndex < toIndex) { wrappedDistance = -wrappedDistance; } return (ABS(directDistance) <= ABS(wrappedDistance))? directDistance: wrappedDistance; } return directDistance; } - (CGFloat)minScrollDistanceFromOffset:(CGFloat)fromOffset toOffset:(CGFloat)toOffset { CGFloat directDistance = toOffset - fromOffset; if (shouldWrap) { CGFloat wrappedDistance = fminf(toOffset, fromOffset) + numberOfItems*itemWidth - fmaxf(toOffset, fromOffset); if (fromOffset < toOffset) { wrappedDistance = -wrappedDistance; } return (fabsf(directDistance) <= fabsf(wrappedDistance))? directDistance: wrappedDistance; } return directDistance; } - (void)scrollByNumberOfItems:(NSInteger)itemCount duration:(NSTimeInterval)duration { if (duration > 0.0) { scrolling = YES; startTime = CACurrentMediaTime(); startOffset = scrollOffset; scrollDuration = duration; previousItemIndex = roundf(scrollOffset/itemWidth); if (itemCount > 0) { endOffset = itemWidth? ((floorf(startOffset / itemWidth) + itemCount) * itemWidth): 0.0f; } else if (itemCount < 0) { endOffset = itemWidth? ((ceilf(startOffset / itemWidth) + itemCount) * itemWidth): 0.0f; } else { endOffset = itemWidth? (roundf(startOffset / itemWidth) * itemWidth): 0.0f; } if (!shouldWrap) { endOffset = [self clampedOffset:endOffset]; } if ([delegate respondsToSelector:@selector(carouselWillBeginScrollingAnimation:)]) { [delegate carouselWillBeginScrollingAnimation:self]; } [self startAnimation]; } else { scrolling = NO; decelerating = NO; [self disableAnimation]; scrollOffset = itemWidth * [self clampedIndex:previousItemIndex + itemCount]; previousItemIndex = previousItemIndex + itemCount; [self didScroll]; [self depthSortViews]; [self enableAnimation]; } } - (void)scrollToItemAtIndex:(NSInteger)index duration:(NSTimeInterval)duration { [self scrollByNumberOfItems:[self minScrollDistanceFromIndex:roundf(scrollOffset/itemWidth) toIndex:index] duration:duration]; } - (void)scrollToItemAtIndex:(NSInteger)index animated:(BOOL)animated { [self scrollToItemAtIndex:index duration:animated? SCROLL_DURATION: 0]; } - (void)removeItemAtIndex:(NSInteger)index animated:(BOOL)animated { index = [self clampedIndex:index]; UIView *itemView = [self itemViewAtIndex:index]; if (animated) { #ifdef ICAROUSEL_IOS [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:0.1]; [UIView setAnimationDelegate:itemView.superview]; [UIView setAnimationDidStopSelector:@selector(removeFromSuperview)]; [self performSelector:@selector(queueItemView:) withObject:itemView afterDelay:0.1]; itemView.superview.layer.opacity = 0.0f; [UIView commitAnimations]; [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:INSERT_DURATION]; [UIView setAnimationDelegate:self]; [UIView setAnimationDidStopSelector:@selector(depthSortViews)]; [self removeViewAtIndex:index]; numberOfItems --; if (![dataSource respondsToSelector:@selector(numberOfVisibleItemsInCarousel:)]) { numberOfVisibleItems --; } scrollOffset = itemWidth * self.currentItemIndex; [self didScroll]; [UIView commitAnimations]; #else [CATransaction begin]; [CATransaction setAnimationDuration:0.1]; [CATransaction setCompletionBlock:^{ [self queueItemView:itemView]; [itemView.superview removeFromSuperview]; }]; itemView.superview.layer.opacity = 0.0f; [CATransaction commit]; [CATransaction begin]; [CATransaction setAnimationDuration:INSERT_DURATION]; [CATransaction setCompletionBlock:^{ [self depthSortViews]; }]; [self removeViewAtIndex:index]; numberOfItems --; scrollOffset = itemWidth * self.currentItemIndex; [self didScroll]; [CATransaction commit]; #endif } else { [self disableAnimation]; [self queueItemView:itemView]; [itemView.superview removeFromSuperview]; [self removeViewAtIndex:index]; numberOfItems --; scrollOffset = itemWidth * self.currentItemIndex; [self didScroll]; [self depthSortViews]; [self enableAnimation]; } } - (void)fadeInItemView:(UIView *)itemView { NSInteger index = [self indexOfItemView:itemView]; CGFloat offset = [self offsetForItemAtIndex:index]; CGFloat alpha = [self alphaForItemWithOffset:offset]; #ifdef ICAROUSEL_IOS [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:0.1f]; itemView.superview.layer.opacity = alpha; [UIView commitAnimations]; #else [CATransaction begin]; [CATransaction setAnimationDuration:0.1f]; itemView.superview.layer.opacity = alpha; [CATransaction commit]; #endif } - (void)insertItemAtIndex:(NSInteger)index animated:(BOOL)animated { numberOfItems ++; if (![dataSource respondsToSelector:@selector(numberOfVisibleItemsInCarousel:)]) { numberOfVisibleItems ++; } index = [self clampedIndex:index]; [self insertView:nil atIndex:index]; UIView *itemView = [self loadViewAtIndex:index]; itemView.superview.layer.opacity = 0.0f; if (itemWidth == 0) { [self updateItemWidth]; } if (animated) { #ifdef ICAROUSEL_IOS [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:INSERT_DURATION]; [UIView setAnimationDelegate:self]; [UIView setAnimationDidStopSelector:@selector(loadUnloadViews)]; [self transformItemViews]; [UIView commitAnimations]; #else [CATransaction begin]; [CATransaction setAnimationDuration:INSERT_DURATION]; [CATransaction setCompletionBlock:^{ [self loadUnloadViews]; }]; [self transformItemViews]; [CATransaction commit]; #endif [self performSelector:@selector(fadeInItemView:) withObject:itemView afterDelay:INSERT_DURATION - 0.1f]; } else { [self disableAnimation]; [self transformItemViews]; [self enableAnimation]; itemView.superview.layer.opacity = 1.0f; } if (scrollOffset < 0.0f) { [self scrollToItemAtIndex:0 animated:(animated && numberOfPlaceholders)]; } } - (void)reloadItemAtIndex:(NSInteger)index animated:(BOOL)animated { //get container view UIView *containerView = [[self itemViewAtIndex:index] superview]; if (animated) { //fade transition CATransition *transition = [CATransition animation]; transition.duration = INSERT_DURATION; transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; transition.type = kCATransitionFade; [containerView.layer addAnimation:transition forKey:nil]; } //reload view [self loadViewAtIndex:index withContainerView:containerView]; } #pragma mark - #pragma mark Animation - (void)startAnimation { if (!timer) { if (useDisplayLink) { #ifdef ICAROUSEL_IOS #ifndef USING_CHAMELEON //support for Chameleon timer = [CADisplayLink displayLinkWithTarget:self selector:@selector(step)]; [timer addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes]; #endif #else CVDisplayLinkCreateWithActiveCGDisplays((void *)&timer); CVDisplayLinkSetOutputCallback((__AH_BRIDGE CVDisplayLinkRef)timer, (CVDisplayLinkOutputCallback)&displayLinkCallback, (__AH_BRIDGE void *)self); CVDisplayLinkStart((__AH_BRIDGE CVDisplayLinkRef)timer); #endif } //use timer if display link //disabled or unavailable if (!timer) { timer = [NSTimer timerWithTimeInterval:1.0/60.0 target:self selector:@selector(step) userInfo:nil repeats:YES]; [[NSRunLoop mainRunLoop] addTimer:timer forMode:NSRunLoopCommonModes]; } } } - (void)stopAnimation { NSLog(@"event stop"); NSLog(@"%d",self.currentItemIndex); #ifdef ICAROUSEL_IOS [timer invalidate]; #else if ([timer isKindOfClass:[NSTimer class]]) { [timer invalidate]; } else { CVDisplayLinkStop((__AH_BRIDGE CVDisplayLinkRef)timer); CVDisplayLinkRelease((__AH_BRIDGE CVDisplayLinkRef)timer); } #endif timer = nil; } - (CGFloat)decelerationDistance { CGFloat acceleration = -startVelocity * DECELERATION_MULTIPLIER * (1.0f - decelerationRate); return -powf(startVelocity, 2.0f) / (2.0f * acceleration); } - (BOOL)shouldDecelerate { return (fabsf(startVelocity) > itemWidth * SCROLL_SPEED_THRESHOLD) && (fabsf([self decelerationDistance]) > itemWidth * DECELERATE_THRESHOLD); } - (BOOL)shouldScroll { return (fabsf(startVelocity) > itemWidth * SCROLL_SPEED_THRESHOLD) && (fabsf(scrollOffset/itemWidth - self.currentItemIndex) > SCROLL_DISTANCE_THRESHOLD); } - (void)startDecelerating { CGFloat distance = [self decelerationDistance]; startOffset = scrollOffset; endOffset = startOffset + distance; if (stopAtItemBoundary) { if (distance > 0.0f) { endOffset = itemWidth? (ceilf(endOffset / itemWidth) * itemWidth): 0.0f; } else { endOffset = itemWidth? (floorf(endOffset / itemWidth) * itemWidth): 0.0f; } } if (!shouldWrap) { if (bounces) { endOffset = fmaxf(itemWidth * -bounceDistance, fminf((numberOfItems - 1.0f + bounceDistance) * itemWidth, endOffset)); } else { endOffset = [self clampedOffset:endOffset]; } } distance = endOffset - startOffset; startTime = CACurrentMediaTime(); scrollDuration = fabsf(distance) / fabsf(0.5f * startVelocity); if (distance != 0.0f) { decelerating = YES; [self startAnimation]; } } - (CGFloat)easeInOut:(CGFloat)time { return (time < 0.5f)? 0.5f * powf(time * 2.0f, 3.0f): 0.5f * powf(time * 2.0f - 2.0f, 3.0f) + 1.0f; } - (void)step { [self disableAnimation]; NSTimeInterval currentTime = CACurrentMediaTime(); if (toggle != 0.0f) { CGFloat toggleDuration = fminf(1.0f, fmaxf(0.0f, itemWidth / fabsf(startVelocity))); toggleDuration = MIN_TOGGLE_DURATION + (MAX_TOGGLE_DURATION - MIN_TOGGLE_DURATION) * toggleDuration; NSTimeInterval time = fminf(1.0f, (currentTime - toggleTime) / toggleDuration); CGFloat delta = [self easeInOut:time]; toggle = (toggle < 0.0f)? (delta - 1.0f): (1.0f - delta); [self didScroll]; } if (scrolling) { NSTimeInterval time = fminf(1.0f, (currentTime - startTime) / scrollDuration); CGFloat delta = [self easeInOut:time]; scrollOffset = startOffset + (endOffset - startOffset) * delta; [self didScroll]; if (time == 1.0f) { scrolling = NO; [self depthSortViews]; if ([delegate respondsToSelector:@selector(carouselDidEndScrollingAnimation:)]) { [delegate carouselDidEndScrollingAnimation:self]; } } } else if (decelerating) { CGFloat time = fminf(scrollDuration, currentTime - startTime); CGFloat acceleration = -startVelocity/scrollDuration; CGFloat distance = startVelocity * time + 0.5f * acceleration * powf(time, 2.0f); scrollOffset = startOffset + distance; [self didScroll]; if (time == (CGFloat)scrollDuration) { decelerating = NO; if ([delegate respondsToSelector:@selector(carouselDidEndDecelerating:)]) { [delegate carouselDidEndDecelerating:self]; } if (scrollToItemBoundary || (scrollOffset - [self clampedOffset:scrollOffset]) != 0.0f) { if (fabsf(scrollOffset/itemWidth - self.currentItemIndex) < 0.01f) { //call scroll to trigger events for legacy support reasons //even though technically we don't need to scroll at all [self scrollToItemAtIndex:self.currentItemIndex duration:0.01]; } else { [self scrollToItemAtIndex:self.currentItemIndex animated:YES]; } } else { CGFloat difference = (CGFloat)self.currentItemIndex - scrollOffset/itemWidth; if (difference > 0.5) { difference = difference - 1.0f; } else if (difference < -0.5) { difference = 1.0 + difference; } toggleTime = currentTime - MAX_TOGGLE_DURATION * fabsf(difference); toggle = fmaxf(-1.0f, fminf(1.0f, -difference)); } } } else if (toggle == 0.0f) { [self stopAnimation]; } [self enableAnimation]; } //for iOS - (void)didMoveToSuperview { if (self.superview) { [self reloadData]; [self startAnimation]; } else { [self stopAnimation]; } } //for Mac OS - (void)viewDidMoveToSuperview { [self didMoveToSuperview]; } - (void)didScroll { if (shouldWrap || !bounces) { scrollOffset = [self clampedOffset:scrollOffset]; } else { CGFloat min = -bounceDistance * itemWidth; CGFloat max = (fmaxf(numberOfItems - 1, 0.0f) + bounceDistance) * itemWidth; if (scrollOffset < min) { scrollOffset = min; startVelocity = 0.0f; } else if (scrollOffset > max) { scrollOffset = max; startVelocity = 0.0f; } } //check if index has changed NSInteger currentIndex = roundf(scrollOffset/itemWidth); NSInteger difference = [self minScrollDistanceFromIndex:previousItemIndex toIndex:currentIndex]; if (difference) { toggleTime = CACurrentMediaTime(); toggle = fmaxf(-1.0f, fminf(1.0f, -(CGFloat)difference)); #ifdef ICAROUSEL_MACOS if (vertical) { //invert toggle toggle = -toggle; } #endif [self startAnimation]; } [self loadUnloadViews]; [self transformItemViews]; if ([delegate respondsToSelector:@selector(carouselDidScroll:)]) { [delegate carouselDidScroll:self]; } //notify delegate of change index if ([self clampedIndex:previousItemIndex] != self.currentItemIndex && [delegate respondsToSelector:@selector(carouselCurrentItemIndexUpdated:)]) { [delegate carouselCurrentItemIndexUpdated:self]; } //update previous index previousItemIndex = currentIndex; } #ifdef ICAROUSEL_IOS #pragma mark - #pragma mark Gestures and taps - (NSInteger)viewOrSuperviewIndex:(UIView *)view { if (view == nil || view == contentView) { return NSNotFound; } NSInteger index = [self indexOfItemView:view]; if (index == NSNotFound) { return [self viewOrSuperviewIndex:view.superview]; } return index; } - (BOOL)viewOrSuperview:(UIView *)view isKindOfClass:(Class)class { if (view == nil || view == contentView) { return NO; } else if ([view isKindOfClass:class]) { return YES; } return [self viewOrSuperview:view.superview isKindOfClass:class]; } - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gesture shouldReceiveTouch:(UITouch *)touch { if ([gesture isKindOfClass:[UITapGestureRecognizer class]]) { //handle tap NSInteger index = [self viewOrSuperviewIndex:touch.view]; if (index == NSNotFound && centerItemWhenSelected) { //view is a container view index = [self viewOrSuperviewIndex:[touch.view.subviews lastObject]]; } if (index != NSNotFound) { if ([delegate respondsToSelector:@selector(carousel:shouldSelectItemAtIndex:)]) { if (![delegate carousel:self shouldSelectItemAtIndex:index]) { return NO; } } if ([self viewOrSuperview:touch.view isKindOfClass:[UIControl class]] || [self viewOrSuperview:touch.view isKindOfClass:[UITableViewCell class]]) { return NO; } } } else if ([gesture isKindOfClass:[UIPanGestureRecognizer class]]) { if ([self viewOrSuperview:touch.view isKindOfClass:[UISlider class]] || [self viewOrSuperview:touch.view isKindOfClass:[UISwitch class]] || !scrollEnabled) { return NO; } } return YES; } - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gesture { if ([gesture isKindOfClass:[UIPanGestureRecognizer class]]) { //ignore vertical swipes UIPanGestureRecognizer *panGesture = (UIPanGestureRecognizer *)gesture; CGPoint translation = [panGesture translationInView:self]; if (ignorePerpendicularSwipes) { if (vertical) { return fabsf(translation.x) <= fabsf(translation.y); } else { return fabsf(translation.x) >= fabsf(translation.y); } } } return YES; } - (void)didTap:(UITapGestureRecognizer *)tapGesture { NSInteger index = [self indexOfItemView:[tapGesture.view.subviews lastObject]]; if (centerItemWhenSelected && index != self.currentItemIndex) { [self scrollToItemAtIndex:index animated:YES]; } if ([delegate respondsToSelector:@selector(carousel:didSelectItemAtIndex:)]) { [delegate carousel:self didSelectItemAtIndex:index]; } } - (void)didPan:(UIPanGestureRecognizer *)panGesture { if (scrollEnabled) { switch (panGesture.state) { case UIGestureRecognizerStateBegan: { dragging = YES; scrolling = NO; decelerating = NO; previousTranslation = vertical? [panGesture translationInView:self].y: [panGesture translationInView:self].x; if ([delegate respondsToSelector:@selector(carouselWillBeginDragging:)]) { [delegate carouselWillBeginDragging:self]; } break; } case UIGestureRecognizerStateEnded: case UIGestureRecognizerStateCancelled: { dragging = NO; didDrag = YES; if ([self shouldDecelerate]) { didDrag = NO; [self startDecelerating]; } if ([delegate respondsToSelector:@selector(carouselDidEndDragging:willDecelerate:)]) { [delegate carouselDidEndDragging:self willDecelerate:decelerating]; } if (!decelerating && (scrollToItemBoundary || (scrollOffset - [self clampedOffset:scrollOffset]) != 0.0f)) { if (fabsf(scrollOffset/itemWidth - self.currentItemIndex) < 0.01f) { //call scroll to trigger events for legacy support reasons //even though technically we don't need to scroll at all [self scrollToItemAtIndex:self.currentItemIndex duration:0.01]; } else if ([self shouldScroll]) { NSInteger direction = (int)(startVelocity / fabsf(startVelocity)); [self scrollToItemAtIndex:self.currentItemIndex + direction animated:YES]; } else { [self scrollToItemAtIndex:self.currentItemIndex animated:YES]; } } else if ([delegate respondsToSelector:@selector(carouselWillBeginDecelerating:)]) { [delegate carouselWillBeginDecelerating:self]; } break; } default: { CGFloat translation = (vertical? [panGesture translationInView:self].y: [panGesture translationInView:self].x) - previousTranslation; CGFloat factor = 1.0f; if (!shouldWrap && bounces) { factor = 1.0f - fminf(fabsf(scrollOffset - [self clampedOffset:scrollOffset]) / itemWidth, bounceDistance) / bounceDistance; } previousTranslation = vertical? [panGesture translationInView:self].y: [panGesture translationInView:self].x; startVelocity = -(vertical? [panGesture velocityInView:self].y: [panGesture velocityInView:self].x) * factor * scrollSpeed; scrollOffset -= translation * factor * offsetMultiplier; [self didScroll]; } } } } #else #pragma mark - #pragma mark Mouse control - (void)mouseDown:(NSEvent *)theEvent { startVelocity = 0.0f; } - (void)mouseDragged:(NSEvent *)theEvent { if (scrollEnabled) { if (!dragging) { dragging = YES; if ([delegate respondsToSelector:@selector(carouselWillBeginDragging:)]) { [delegate carouselWillBeginDragging:self]; } } scrolling = NO; decelerating = NO; CGFloat translation = vertical? [theEvent deltaY]: [theEvent deltaX]; CGFloat factor = 1.0f; if (!shouldWrap && bounces) { factor = 1.0f - fminf(fabsf(scrollOffset - [self clampedOffset:scrollOffset]) / itemWidth, bounceDistance) / bounceDistance; } NSTimeInterval thisTime = [theEvent timestamp]; startVelocity = -(translation / (thisTime - startTime)) * factor * scrollSpeed; startTime = thisTime; scrollOffset -= translation * factor * offsetMultiplier; [self disableAnimation]; [self didScroll]; [self enableAnimation]; } } - (void)mouseUp:(NSEvent *)theEvent { if (scrollEnabled) { dragging = NO; didDrag = YES; if ([self shouldDecelerate]) { didDrag = NO; [self startDecelerating]; } if ([delegate respondsToSelector:@selector(carouselDidEndDragging:willDecelerate:)]) { [delegate carouselDidEndDragging:self willDecelerate:decelerating]; } if (!decelerating) { if ([self shouldScroll]) { NSInteger direction = (int)(startVelocity / fabsf(startVelocity)); [self scrollToItemAtIndex:self.currentItemIndex + direction animated:YES]; } else { [self scrollToItemAtIndex:self.currentItemIndex animated:YES]; } } else if ([delegate respondsToSelector:@selector(carouselWillBeginDecelerating:)]) { [delegate carouselWillBeginDecelerating:self]; } } } #pragma mark - #pragma mark Scrollwheel control - (void)scrollWheel:(NSEvent *)theEvent { [self mouseDragged:theEvent]; //the iCarousel deceleration system conflicts with the built-in momentum //scrolling for scrollwheel events. need to find a way to trigger the appropriate //events, and also detect when user has disabled momentum scrolling in system prefs dragging = NO; decelerating = NO; if ([delegate respondsToSelector:@selector(carouselDidEndDragging:willDecelerate:)]) { [delegate carouselDidEndDragging:self willDecelerate:decelerating]; } [self scrollToItemAtIndex:self.currentItemIndex animated:YES]; } #pragma mark - #pragma mark Keyboard control - (BOOL)acceptsFirstResponder { return YES; } - (void)keyDown:(NSEvent *)theEvent { NSString *characters = [theEvent charactersIgnoringModifiers]; if (scrollEnabled && !scrolling && [characters length]) { if (vertical) { switch ([characters characterAtIndex:0]) { case NSUpArrowFunctionKey: { [self scrollToItemAtIndex:self.currentItemIndex-1 animated:YES]; break; } case NSDownArrowFunctionKey: { [self scrollToItemAtIndex:self.currentItemIndex+1 animated:YES]; break; } } } else { switch ([characters characterAtIndex:0]) { case NSLeftArrowFunctionKey: { [self scrollToItemAtIndex:self.currentItemIndex-1 animated:YES]; break; } case NSRightArrowFunctionKey: { [self scrollToItemAtIndex:self.currentItemIndex+1 animated:YES]; break; } } } } } #endif @end
009-20120511-z
trunk/Zinipad/Zinipad/iCarousel.m
Objective-C
gpl3
63,643
// // main.m // Zinipad // // Created by ZeLkOvA on 12. 5. 17.. // Copyright (c) 2012년 __MyCompanyName__. All rights reserved. // #import <UIKit/UIKit.h> #import "AppDelegate.h" int main(int argc, char *argv[]) { @autoreleasepool { return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); } }
009-20120511-z
trunk/Zinipad/Zinipad/main.m
Objective-C
gpl3
344
// // SampleBookMainView.m // Zinipad // // Created by ZeLkOvA on 12. 5. 17.. // Copyright (c) 2012년 __MyCompanyName__. All rights reserved. // #import "SampleBookMainView.h" #import "MyTreeViewCell.h" #import "TreeView.h" @implementation SampleBookMainView - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { NSLog(@"asdad"); TreeView *tv = [[TreeView alloc] init]; [tv.view setFrame:CGRectMake(800, 50, 100, 1000)]; [self.view addSubview:tv.view]; } return self; } - (void)didReceiveMemoryWarning { // Releases the view if it doesn't have a superview. [super didReceiveMemoryWarning]; // Release any cached data, images, etc that aren't in use. } #pragma mark - View lifecycle /* // Implement loadView to create a view hierarchy programmatically, without using a nib. - (void)loadView { } */ /* // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. - (void)viewDidLoad { [super viewDidLoad]; } */ - (void)viewDidUnload { // [self.navigationController setNavigationBarHidden:YES]; [super viewDidUnload]; // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations return YES; } @end
009-20120511-z
trunk/Zinipad/Zinipad/SampleBookMainView.m
Objective-C
gpl3
1,534
// // SampleBookMainView.h // Zinipad // // Created by ZeLkOvA on 12. 5. 17.. // Copyright (c) 2012년 __MyCompanyName__. All rights reserved. // #import <UIKit/UIKit.h> @interface SampleBookMainView : UIViewController { } @end
009-20120511-z
trunk/Zinipad/Zinipad/SampleBookMainView.h
Objective-C
gpl3
240
// // AppDelegate.m // Zinipad // // Created by ZeLkOvA on 12. 5. 17.. // Copyright (c) 2012년 __MyCompanyName__. All rights reserved. // #import "AppDelegate.h" #import "SampleBookMainView.h" @implementation AppDelegate @synthesize window = _window; @synthesize _aNavigationController; - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // Override point for customization after application launch. self.window.backgroundColor = [UIColor whiteColor]; SampleBookMainView* sampleBookController = [[SampleBookMainView alloc] init]; _aNavigationContoller = [[UINavigationController alloc] initWithRootViewController:sampleBookController]; [_aNavigationContoller setNavigationBarHidden:YES]; self._aNavigationController = _aNavigationContoller; [self.window addSubview:self._aNavigationController.view]; [self.window makeKeyAndVisible]; // NSLog(@"앱 델리게이트"); return YES; } - (void)applicationWillResignActive:(UIApplication *)application { /* Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. */ } - (void)applicationDidEnterBackground:(UIApplication *)application { /* Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. */ } - (void)applicationWillEnterForeground:(UIApplication *)application { /* Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. */ } - (void)applicationDidBecomeActive:(UIApplication *)application { /* Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. */ } - (void)applicationWillTerminate:(UIApplication *)application { /* Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. */ } @end
009-20120511-z
trunk/Zinipad/Zinipad/AppDelegate.m
Objective-C
gpl3
2,779
<?php /** * classe que represento o cronometro do leilao: * de 30seg, 20seg, 10eg... * @access public * @author Magno Leal * @package model */ class CronometroBean { private $cronometroID; /** * @NotEmptyValidator */ private $valor; function __construct($cronometroID = 0, $valor = "") { $this->cronometroID = $cronometroID; $this->valor = $valor; } public function getCronometroID() { return $this->cronometroID; } public function setCronometroID($cronometroID) { $this->cronometroID = $cronometroID; } public function getValor() { return $this->valor; } public function setValor($valor) { $this->valor = $valor; } public function toJson() { return json_encode($this->toBD()); } public function toBD() { $cronometro = array(); $cronometro['cronometroID'] = $this->cronometroID; $cronometro['valor'] = $this->valor; return $cronometro; } } ?>
0a1b2c3d4e5
trunk/leilao/model/CronometroBean.class.php
PHP
asf20
1,027
<?php /** * classe que representa as informações que o cliente envia ao site: * Sugestão, Reclamação ou Indicação de produto para Leilao * @access public * @author Magno Leal * @package model */ class InformacaoBean { private $informacaoID; /** * @NotEmptyValidator */ private $descricao; private $data; /** * @NotEmptyValidator */ private $tipo; private $cliente; private $status; function __construct($informacaoID = 0, $descricao = "", $data = "", $tipo = -1, $cliente = null, $status = null) { $this->informacaoID = $informacaoID; $this->descricao = $descricao; $this->data = $data; $this->tipo = $tipo; $this->cliente = $cliente; $this->status = $status; } public function getInformacaoID() { return $this->informacaoID; } public function setInformacaoID($informacaoID) { $this->informacaoID = $informacaoID; } public function getDescricao() { return $this->descricao; } public function setDescricao($descricao) { $this->descricao = $descricao; } public function getData() { return $this->data; } public function setData($data) { $this->data = $data; } public function getTipo() { return $this->tipo; } public function setTipo($tipo) { $this->tipo = $tipo; } public function getStatus() { return $this->status; } public function setStatus($status) { $this->status = $status; } public function getCliente() { return $this->cliente; } public function setCliente($cliente) { $this->cliente = $cliente; } public function toJson() { return json_encode($this->toBD()); } public function toBD() { $informacao = array(); $informacao['informacaoID'] = $this->informacaoID; $informacao['descricao'] = $this->descricao; $informacao['data'] = $this->data; $informacao['tipo'] = $this->tipo; $informacao['clienteID'] = $this->cliente->getUsuarioID(); $informacao['statusID'] = $this->status->getStatusID(); return $informacao; } } ?>
0a1b2c3d4e5
trunk/leilao/model/InformacaoBean.class.php
PHP
asf20
2,246
<?php /** * Classe que representa a cidade do Endereço * @access public * @author Magno Leal * @package model */ class CidadeBean { /** * @AttributeType long */ private $cidadeID; /** * @AttributeType String */ private $nome; /** * @AssociationType model.Estado * @AssociationMultiplicity 1 */ public $estado; function __construct($cidadeID = 0, $nome = "", $estado = null) { $this->cidadeID = $cidadeID; $this->nome = $nome; $this->estado = $estado; } public function getCidadeID() { return $this->cidadeID; } public function setCidadeID($cidadeID) { $this->cidadeID = $cidadeID; } public function getNome() { return $this->nome; } public function setNome($nome) { $this->nome = $nome; } public function getEstado() { return $this->estado; } public function setEstado($estado) { $this->estado = $estado; } public function toBD() { $cidade = array(); $cidade['cidadeID'] = $this->cidadeID; $cidade['nome'] = $this->nome; $cidade['estadoID'] = $this->estado->getEstadoID(); return $cidade; } public function toJson() { return json_encode($this->toBD()); } } ?>
0a1b2c3d4e5
trunk/leilao/model/CidadeBean.class.php
PHP
asf20
1,401
<?php /** * classe que representa os usuarios clientes do site * @access public * @author Magno Leal * @package model */ class ClienteBean extends UsuarioBean{ private $numLances; private $avisosPorEmail; /** * @AssociationType model.Pessoa * @AssociationMultiplicity 1 */ private $pessoa; /** * @AssociationType model.Informacao * @AssociationMultiplicity * */ private $informacoes; /** * @AssociationType model.Depoimento * @AssociationMultiplicity * */ private $depoimentos; /** * @AssociationType model.Compra * @AssociationMultiplicity * */ private $compras; /** * @AssociationType model.Convites * @AssociationMultiplicity * */ private $convites; /** * @AssociationType model.ClienteBonus * @AssociationMultiplicity * */ private $clienteBonus; /** * @AssociationType model.CategoriaProduto * @AssociationMultiplicity * */ private $interesses; /** * @AssociationType model.Votos * @AssociationMultiplicity * */ private $votos; /** * @AssociationType model.Votos * @AssociationMultiplicity * */ private $lances; public function __construct($usuarioID = 0, $login = "", $senha = "", $email = "", $ip = "", $dataCriacao = "", $media = null, $status = null, $numLances = 0, $avisosPorEmail = -1) { parent::__construct($usuarioID, $login, $senha, $email, $ip, $dataCriacao, $media, $status); $this->numLances = $numLances; $this->avisosPorEmail = $avisosPorEmail; } public function getNumLances() { return $this->numLances; } public function setNumLances($numLances) { $this->numLances = $numLances; } public function getAvisosPorEmail() { return $this->avisosPorEmail; } public function setAvisosPorEmail($avisosPorEmail) { $this->avisosPorEmail = $avisosPorEmail; } public function getUsuario() { return new UsuarioBean(parent::getUsuarioID(), parent::getLogin(), parent::getSenha(), parent::getEmail(), parent::getIp(), parent::getDataCriacao(), parent::getMedia(), parent::getStatus()); } public function setUsuario($usuario) { parent::__construct($usuario->getUsuarioID(), $usuario->getLogin(), $usuario->getSenha(), $usuario->getEmail(), $usuario->getIp(), $usuario->getDataCriacao(), $usuario->getMedia(), $usuario->getStatus()); } public function getPessoa() { return $this->pessoa; } public function setPessoa($pessoa) { $this->pessoa = $pessoa; } public function setInformacoes($informacoes) { $this->informacoes = $informacoes; } public function setDepoimentos($depoimentos) { $this->depoimentos = $depoimentos; } public function setCompras($compras) { $this->compras = $compras; } public function setConvites($convites) { $this->convites = $convites; } public function setClienteBonus($clienteBonus) { $this->clienteBonus = $clienteBonus; } public function setInteresses($interesses) { $this->interesses = $interesses; } public function setVotos($votos) { $this->votos = $votos; } public function getInformacoes() { return $this->informacoes; } public function getDepoimentos() { return $this->depoimentos; } public function getCompras() { return $this->compras; } public function getConvites() { return $this->convites; } public function getClienteBonus() { return $this->clienteBonus; } public function getInteresses() { return $this->interesses; } public function getVotos() { return $this->votos; } public function getLances() { return $this->lances; } public function setLances($lances) { $this->lances = $lances; } public function toJson() { return json_encode($this->toBD()); } public function toBD() { $cliente = array(); $cliente['usuarioID'] = parent::getUsuarioID(); $cliente['numLances'] = $this->numLances; $cliente['avisosPorEmail'] = $this->avisosPorEmail; return $cliente; } } ?>
0a1b2c3d4e5
trunk/leilao/model/ClienteBean.class.php
PHP
asf20
4,396
<?php /** * classe que represento as media dos Produtos dos leiloes (imagem ou video) * @access public * @author Magno Leal * @package model */ class MediaProdutoBean { private $mediaProdutoID; /** * @NotEmptyValidator */ private $caminho; private $produto; function __construct($mediaProdutoID = 0, $caminho = "", $produto = null) { $this->mediaProdutoID = $mediaProdutoID; $this->caminho = $caminho; $this->produto = $produto; } public function getMediaProdutoID() { return $this->mediaProdutoID; } public function setMediaProdutoID($mediaProdutoID) { $this->mediaProdutoID = $mediaProdutoID; } public function getCaminho() { return $this->caminho; } public function setCaminho($caminho) { $this->caminho = $caminho; } public function getProduto() { return $this->produto; } public function setProduto($produto) { $this->produto = $produto; } public function toJson() { return json_encode($this->toBD()); } public function toBD() { $mediaProduto = array(); $mediaProduto['mediaProdutoID'] = $this->mediaProdutoID; $mediaProduto['caminho'] = $this->caminho; $mediaProduto['produtoID'] = $this->produto->getProdutoID(); return $mediaProduto; } } ?>
0a1b2c3d4e5
trunk/leilao/model/MediaProdutoBean.class.php
PHP
asf20
1,386
<?php /** * classe que representa os usuarios administradores do site * @access public * @author Magno Leal * @package model */ class AdminBean extends UsuarioBean{ public function __construct($usuarioID = 0, $login = "", $senha = "", $email = "", $ip = "", $dataCriacao = "", $media = null, $status = null) { parent::__construct($usuarioID, $login, $senha, $email, $ip, $dataCriacao, $media, $status); } public function getUsuario() { return new UsuarioBean(parent::getUsuarioID(), parent::getLogin(), parent::getSenha(), parent::getEmail(), parent::getIp(), parent::getDataCriacao(), parent::getMedia(), parent::getStatus()); } public function setUsuario($usuario) { parent::__construct($usuario->getUsuarioID(), $usuario->getLogin(), $usuario->getSenha(), $usuario->getEmail(), $usuario->getIp(), $usuario->getDataCriacao(), $usuario->getMedia(), $usuario->getStatus()); } } ?>
0a1b2c3d4e5
trunk/leilao/model/AdminBean.class.php
PHP
asf20
970
<?php /** * classe que represento os logins de cada usuario * @access public * @author Magno Leal * @package model */ class LoginBean { private $loginID; private $data; private $ip; private $usuario; function __construct($loginID = 0, $data = "", $ip = "", $usuario = null) { $this->loginID = $loginID; $this->data = $data; $this->ip = $ip; $this->usuario = $usuario; } public function getLoginID() { return $this->loginID; } public function setLoginID($loginID) { $this->loginID = $loginID; } public function getData() { return $this->data; } public function setData($data) { $this->data = $data; } public function getIp() { return $this->ip; } public function setIp($ip) { $this->ip = $ip; } public function getUsuario() { return $this->usuario; } public function setUsuario($usuario) { $this->usuario = $usuario; } public function toJson() { return json_encode($this->toBD()); } public function toBD() { $login = array(); $login['loginID'] = $this->loginID; #$login['data'] = $this->data; #$login['ip'] = $this->ip; $login['usuarioID'] = $this->usuario->getUsuarioID(); return $login; } } ?>
0a1b2c3d4e5
trunk/leilao/model/LoginBean.class.php
PHP
asf20
1,371
<?php /** * classe que represento os pacotes de venda de lances: * pacote de 25, 50, 100, 300, 500 lances * @access public * @author Magno Leal * @package model */ class PacoteLanceBean { private $pacoteLanceID; /** * @NotEmptyValidator */ private $quantidade; /** * @NotEmptyValidator */ private $valor; function __construct($pacoteLanceID = 0, $quantidade = "", $valor = -1) { $this->pacoteLanceID = $pacoteLanceID; $this->quantidade = $quantidade; $this->valor = $valor; } public function getPacoteLanceID() { return $this->pacoteLanceID; } public function setPacoteLanceID($pacoteLanceID) { $this->pacoteLanceID = $pacoteLanceID; } public function getQuantidade() { return $this->quantidade; } public function setQuantidade($quantidade) { $this->quantidade = $quantidade; } public function getValor() { return $this->valor; } public function setValor($valor) { $this->valor = $valor; } public function toJson() { return json_encode($this->toBD()); } public function toBD() { $pacoteLance = array(); $pacoteLance['pacoteLanceID'] = $this->pacoteLanceID; $pacoteLance['quantidade'] = $this->quantidade; $pacoteLance['valor'] = $this->valor; return $pacoteLance; } } ?>
0a1b2c3d4e5
trunk/leilao/model/PacoteLanceBean.class.php
PHP
asf20
1,423
<?php /** * classe que represento as medias do sistema (imagem ou video) * @access public * @author Magno Leal * @package model */ class MediaBean { private $mediaID; /** * @NotEmptyValidator */ private $caminho; function __construct($mediaID = 0, $caminho = "") { $this->mediaID = $mediaID; $this->caminho = $caminho; } public function getMediaID() { return $this->mediaID; } public function setMediaID($mediaID) { $this->mediaID = $mediaID; } public function getCaminho() { return $this->caminho; } public function getCaminhoMini() { return Util::getMediaMini($this->caminho); } public function setCaminho($caminho) { $this->caminho = $caminho; } public function toJson() { return json_encode($this->toBD()); } public function toBD() { $media = array(); $media['mediaID'] = $this->mediaID; $media['caminho'] = $this->caminho; return $media; } } ?>
0a1b2c3d4e5
trunk/leilao/model/MediaBean.class.php
PHP
asf20
1,058
<?php /** * Classe que representa a Pessoa do Cliente * @access public * @author Magno Leal * @package model */ class PessoaBean { private $cliente; /** * @NotEmptyValidator */ private $nome; /** * @MaskValidator(mask = "999.999.999-99") */ private $cpf; /** * @NotEmptyValidator */ private $sexo; /** * @NotEmptyValidator */ private $dataNascimento; /** * @NotEmptyValidator */ private $estadoCivil; /** * @NotEmptyValidator */ private $telefone; private $endereco; function __construct($cliente = null, $nome = "", $cpf = "", $sexo = -1, $dataNascimento = "", $estadoCivil = -1, $telefone = "", $endereco = null) { $this->cliente = $cliente; $this->nome = $nome; $this->cpf = $cpf; $this->sexo = $sexo; $this->dataNascimento = $dataNascimento; $this->estadoCivil = $estadoCivil; $this->telefone = $telefone; } public function getCliente() { return $this->cliente; } public function setCliente($cliente) { $this->cliente = $cliente; } public function getNome() { return $this->nome; } public function setNome($nome) { $this->nome = $nome; } public function getCpf() { return $this->cpf; } public function setCpf($cpf) { $this->cpf = $cpf; } public function getSexo() { return $this->sexo; } public function setSexo($sexo) { $this->sexo = $sexo; } public function getDataNascimento() { return $this->dataNascimento; } public function setDataNascimento($dataNascimento) { $this->dataNascimento = $dataNascimento; } public function getEstadoCivil() { return $this->estadoCivil; } public function setEstadoCivil($estadoCivil) { $this->estadoCivil = $estadoCivil; } public function getTelefone() { return $this->telefone; } public function setTelefone($telefone) { $this->telefone = $telefone; } public function getEndereco() { return $this->endereco; } public function setEndereco($endereco) { $this->endereco = $endereco; } public function toBD() { $pessoa = array(); $pessoa['usuarioID'] = $this->cliente->getUsuarioID(); $pessoa['nome'] = $this->nome; $pessoa['cpf'] = $this->cpf; $pessoa['sexo'] = intval($this->sexo); $pessoa['dataNascimento'] = Util::stringToDate($this->dataNascimento); $pessoa['estadoCivil'] = intval($this->estadoCivil); $pessoa['telefone'] = $this->telefone; return $pessoa; } public function toJson() { return json_encode($this->toBD()); } } ?>
0a1b2c3d4e5
trunk/leilao/model/PessoaBean.class.php
PHP
asf20
2,844
<?php /** * classe que represento os tipo de leiloes do sistema: * Leiloes de Frete Gratis, Leiloes Gratis, etc * @access public * @author Magno Leal * @package model */ class TipoLeilaoBean { private $tipoLeilaoID; /** * @NotEmptyValidator */ private $descricao; function __construct($tipoLeilaoID = 0, $descricao = "") { $this->tipoLeilaoID = $tipoLeilaoID; $this->descricao = $descricao; } public function getTipoLeilaoID() { return $this->tipoLeilaoID; } public function setTipoLeilaoID($tipoLeilaoID) { $this->tipoLeilaoID = $tipoLeilaoID; } public function getDescricao() { return $this->descricao; } public function setDescricao($descricao) { $this->descricao = $descricao; } public function toJson() { return json_encode($this->toBD()); } public function toBD() { $tipoLeilao = array(); $tipoLeilao['tipoLeilaoID'] = $this->tipoLeilaoID; $tipoLeilao['descricao'] = $this->descricao; return $tipoLeilao; } } ?>
0a1b2c3d4e5
trunk/leilao/model/TipoLeilaoBean.class.php
PHP
asf20
1,102
<?php /** * classe que represento os status do sistema * @access public * @author Magno Leal * @package model */ class StatusBean { private $statusID; /** * @NotEmptyValidator */ private $descricao; /** * @NotEmptyValidator */ private $tipo; function __construct($statusID = 0, $descricao = "", $tipo = -1) { $this->statusID = $statusID; $this->descricao = $descricao; $this->tipo = $tipo; } public function getStatusID() { return $this->statusID; } public function setStatusID($statusID) { $this->statusID = $statusID; } public function getDescricao() { return $this->descricao; } public function setDescricao($descricao) { $this->descricao = $descricao; } public function getTipo() { return $this->tipo; } public function setTipo($tipo) { $this->tipo = $tipo; } public function toJson() { return json_encode($this->toBD()); } public function toBD() { $status = array(); $status['statusID'] = $this->statusID; $status['descricao'] = $this->descricao; $status['tipo'] = $this->tipo; return $status; } } ?>
0a1b2c3d4e5
trunk/leilao/model/StatusBean.class.php
PHP
asf20
1,257
<?php /** * classe que representa as enquetes do sistema * @access public * @author Magno Leal * @package model */ class EnqueteBean { private $enqueteID; /** * @NotEmptyValidator */ private $descricao; private $inicio; /** * @NotEmptyValidator */ private $fim; private $status; function __construct($enqueteID = 0, $descricao = "", $inicio = "", $fim = "", $status = null) { $this->enqueteID = $enqueteID; $this->descricao = $descricao; $this->inicio = $inicio; $this->fim = $fim; $this->status = $status; } public function getEnqueteID() { return $this->enqueteID; } public function setEnqueteID($enqueteID) { $this->enqueteID = $enqueteID; } public function getDescricao() { return $this->descricao; } public function setDescricao($descricao) { $this->descricao = $descricao; } public function getInicio() { return $this->inicio; } public function setInicio($inicio) { $this->inicio = $inicio; } public function getFim() { return $this->fim; } public function setFim($fim) { $this->fim = $fim; } public function getStatus() { return $this->status; } public function setStatus($status) { $this->status = $status; } public function toJson() { return json_encode($this->toBD()); } public function toBD() { $enquete = array(); $enquete['enqueteID'] = $this->enqueteID; $enquete['descricao'] = $this->descricao; //$enquete['inicio'] = Util::stringToDate($this->inicio); $enquete['fim'] = Util::stringToDate($this->fim); $enquete['statusID'] = $this->status->getStatusID(); return $enquete; } } ?>
0a1b2c3d4e5
trunk/leilao/model/EnqueteBean.class.php
PHP
asf20
1,853
<?php /** * Classe que representa o Estado da Cidade * @access public * @author Magno Leal * @package model */ class EstadoBean { /** * @AttributeType long */ private $estadoID; /** * @AttributeType String */ private $nome; /** * @AttributeType String */ private $sigla; function __construct($estadoID = 0, $nome = "", $sigla = "") { $this->estadoID = $estadoID; $this->nome = $nome; $this->sigla = $sigla; } public function getEstadoID() { return $this->estadoID; } public function setEstadoID($estadoID) { $this->estadoID = $estadoID; } public function getNome() { return $this->nome; } public function setNome($nome) { $this->nome = $nome; } public function getSigla() { return $this->sigla; } public function setSigla($sigla) { $this->sigla = $sigla; } public function toBD() { $estado = array(); $estado['estadoID'] = $this->estadoID; $estado['nome'] = $this->nome; $estado['sigla'] = $this->sigla; return $estado; } public function toJson() { return json_encode($this->toBD()); } } ?>
0a1b2c3d4e5
trunk/leilao/model/EstadoBean.class.php
PHP
asf20
1,321
<?php /** * classe que representa os bonus comprados pelo cliente * @access public * @author Magno Leal * @package model */ class ClienteBonusBean { private $cliente; private $bonus; /** * @NotEmptyValidator */ private $valor; private $inicio; /** * @NotEmptyValidator */ private $fim; function __construct($cliente = null, $bonus = null, $valor = "", $inicio = "", $fim = "") { $this->cliente = $cliente; $this->valor = $valor; $this->inicio = $inicio; $this->fim = $fim; $this->bonus = $bonus; } public function getCliente() { return $this->cliente; } public function setCliente($cliente) { $this->cliente = $cliente; } public function getValor() { return $this->valor; } public function setValor($valor) { $this->valor = $valor; } public function getInicio() { return $this->inicio; } public function setInicio($inicio) { $this->inicio = $inicio; } public function getFim() { return $this->fim; } public function setFim($fim) { $this->fim = $fim; } public function getBonus() { return $this->bonus; } public function setBonus($bonus) { $this->bonus = $bonus; } public function toJson() { return json_encode($this->toBD()); } public function toBD() { $clienteBonus = array(); $clienteBonus['clienteID'] = $this->cliente->getUsuarioID(); $clienteBonus['bonusID'] = $this->bonus->getBonusID(); $clienteBonus['valor'] = $this->valor; $clienteBonus['inicio'] = $this->inicio; $clienteBonus['fim'] = $this->fim; return $clienteBonus; } } ?>
0a1b2c3d4e5
trunk/leilao/model/ClienteBonusBean.class.php
PHP
asf20
1,808
<?php /** * Classe que representa o Endereco da Pessoa * @access public * @author Magno Leal * @package model */ class EnderecoBean { private $pessoa; /** * @NotEmptyValidator */ private $logradouro; /** * @NotEmptyValidator */ private $numero; private $complemento; /** * @NotEmptyValidator */ private $bairro; /** * @NotEmptyValidator */ private $cep; private $cidade; function __construct($pessoa = null, $logradouro = "", $numero = 0, $complemento = "", $bairro = "", $cep = "", $cidade = null) { $this->pessoa = $pessoa; $this->logradouro = $logradouro; $this->numero = $numero; $this->complemento = $complemento; $this->bairro = $bairro; $this->cep = $cep; $this->cidade = $cidade; } public function getPessoa() { return $this->pessoa; } public function setPessoa($pessoa) { $this->pessoa = $pessoa; } public function getLogradouro() { return $this->logradouro; } public function setLogradouro($logradouro) { $this->logradouro = $logradouro; } public function getNumero() { return $this->numero; } public function setNumero($numero) { $this->numero = $numero; } public function getComplemento() { return $this->complemento; } public function setComplemento($complemento) { $this->complemento = $complemento; } public function getBairro() { return $this->bairro; } public function setBairro($bairro) { $this->bairro = $bairro; } public function getCep() { return $this->cep; } public function setCep($cep) { $this->cep = $cep; } public function getCidade() { return $this->cidade; } public function setCidade($cidade) { $this->cidade = $cidade; } public function toBD() { $endereco = array(); $endereco['usuarioID'] = $this->pessoa->getCliente()->getUsuarioID(); $endereco['logradouro'] = $this->logradouro; $endereco['numero'] = $this->numero; $endereco['complemento'] = $this->complemento; $endereco['bairro'] = $this->bairro; $endereco['cep'] = $this->cep; $endereco['cidadeID'] = $this->cidade->getCidadeID(); return $endereco; } public function toJson() { return json_encode($this->toBD()); } } ?>
0a1b2c3d4e5
trunk/leilao/model/EnderecoBean.class.php
PHP
asf20
2,506
<?php /** * classe que representa os convites que os cliente enviam * @access public * @author Magno Leal * @package model */ class ConviteBean { private $conviteID; /** * @EmailValidator */ private $email; /** * @NotEmptyValidator */ private $mensagem; private $cliente; private $convidado; private $status; function __construct($conviteID = 0, $email = "", $mensagem = "", $cliente = null, $convidado = null, $status = null) { $this->conviteID = $conviteID; $this->email = $email; $this->mensagem = $mensagem; $this->convidado = $convidado; $this->cliente = $cliente; $this->status = $status; } public function getConviteID() { return $this->conviteID; } public function setConviteID($conviteID) { $this->conviteID = $conviteID; } public function getEmail() { return $this->email; } public function setEmail($email) { $this->email = $email; } public function getMensagem() { return $this->mensagem; } public function setMensagem($mensagem) { $this->mensagem = $mensagem; } public function getConvidado() { return $this->convidado; } public function setConvidado($convidado) { $this->convidado = $convidado; } public function getStatus() { return $this->status; } public function setStatus($status) { $this->status = $status; } public function getCliente() { return $this->cliente; } public function setCliente($cliente) { $this->cliente = $cliente; } public function toJson() { return json_encode($this->toBD()); } public function toBD() { $convite = array(); $convite['conviteID'] = $this->conviteID; $convite['email'] = $this->email; $convite['mensagem'] = $this->mensagem; $convite['usuarioID'] = $this->cliente->getUsuarioID(); $convite['statusID'] = $this->status->getStatusID(); if($this->convidado != null) $convite['convidadoID'] = $this->convidado->getUsuarioID(); else $convite['convidadoID'] = null; return $convite; } } ?>
0a1b2c3d4e5
trunk/leilao/model/ConviteBean.class.php
PHP
asf20
2,302
<?php /** * classe que representa as compras de lances feitas pelo cliente * @access public * @author Magno Leal * @package model */ class CompraBean { private $compraID; private $data; private $ip; /** * @NotEmptyValidator */ private $valor; private $pacoteLance; private $cliente; private $status; function __construct($compraID = 0, $data = "", $ip = "", $valor = -1, $pacoteLance = null, $cliente = null, $status = null) { $this->compraID = $compraID; $this->valor = $valor; $this->data = $data; $this->ip = $ip; $this->pacoteLance = $pacoteLance; $this->cliente = $cliente; $this->status = $status; } public function getCompraID() { return $this->compraID; } public function setCompraID($compraID) { $this->compraID = $compraID; } public function getValor() { return $this->valor; } public function setValor($valor) { $this->valor = $valor; } public function getData() { return $this->data; } public function setData($data) { $this->data = $data; } public function getIp() { return $this->ip; } public function setIp($ip) { $this->ip = $ip; } public function getStatus() { return $this->status; } public function setStatus($status) { $this->status = $status; } public function getCliente() { return $this->cliente; } public function setCliente($cliente) { $this->cliente = $cliente; } public function getPacoteLance() { return $this->pacoteLance; } public function setPacoteLance($pacoteLance) { $this->pacoteLance = $pacoteLance; } public function toJson() { return json_encode($this->toBD()); } public function toBD() { $compra = array(); $compra['compraID'] = $this->compraID; $compra['valor'] = $this->valor; $compra['data'] = $this->data; $compra['ip'] = $this->ip; $compra['pacoteLanceID'] = $this->pacoteLance->getPacoteLanceID(); $compra['clienteID'] = $this->cliente->getUsuarioID(); $compra['statusID'] = $this->status->getStatusID(); return $compra; } } ?>
0a1b2c3d4e5
trunk/leilao/model/CompraBean.class.php
PHP
asf20
2,325
<?php /** * classe que represento os bonus que o cliente pode adiquirir: <br/> * 1 - Nao pagar pelo valor do produto no fim dos leiloes;<br/> * 2 - Nao pagar pelo frete;<br/> * 3 - Retirar informações dos usuarios durante o leilão;<br/> * 4 - etc...<br/> * * @access public * @author Magno Leal * @package model */ class BonusBean { private $bonusID; /** * @NotEmptyValidator */ private $descricao; /** * @NotEmptyValidator */ private $valor; function __construct($bonusID = 0, $descricao = "", $valor = -1) { $this->bonusID = $bonusID; $this->descricao = $descricao; $this->valor = $valor; } public function getBonusID() { return $this->bonusID; } public function setBonusID($bonusID) { $this->bonusID = $bonusID; } public function getDescricao() { return $this->descricao; } public function setDescricao($descricao) { $this->descricao = $descricao; } public function getValor() { return $this->valor; } public function setValor($valor) { $this->valor = $valor; } public function toJson() { return json_encode($this->toBD()); } public function toBD() { $bonus = array(); $bonus['bonusID'] = $this->bonusID; $bonus['descricao'] = $this->descricao; $bonus['valor'] = $this->valor; return $bonus; } } ?>
0a1b2c3d4e5
trunk/leilao/model/BonusBean.class.php
PHP
asf20
1,468
<?php /** * classe que represento os votos das enquete em determinada resposta * @access public * @author Magno Leal * @package model */ class VotoBean { private $enquete; private $cliente; private $resposta; private $data; function __construct($enquete = null, $cliente = null, $resposta = null, $data = "") { $this->enquete = $enquete; $this->data = $data; $this->resposta = $resposta; $this->cliente = $cliente; } public function getEnquete() { return $this->enquete; } public function setEnquete($enquete) { $this->enquete = $enquete; } public function getData() { return $this->data; } public function setData($data) { $this->data = $data; } public function getResposta() { return $this->resposta; } public function setResposta($resposta) { $this->resposta = $resposta; } public function getCliente() { return $this->cliente; } public function setCliente($cliente) { $this->cliente = $cliente; } public function toJson() { return json_encode($this->toBD()); } public function toBD() { $voto = array(); $voto['enqueteID'] = $this->enquete->getEnqueteID(); $voto['respostaID'] = $this->resposta->getRespostaID(); $voto['clienteID'] = $this->cliente->getUsuarioID(); $voto['data'] = $this->data; return $voto; } } ?>
0a1b2c3d4e5
trunk/leilao/model/VotoBean.class.php
PHP
asf20
1,499
<?php /** * Classe que representa a resposta da enquete * @access public * @author Magno Leal * @package model */ class RespostaBean { /** * /@AttributeType long */ private $respostaID; /** * @NotEmptyValidator */ private $descricao; /** * /@AssociationType model.Enquete * /@AssociationMultiplicity 1 */ public $enquete; function __construct($respostaID = 0, $descricao = "", $enquete = null) { $this->respostaID = $respostaID; $this->descricao = $descricao; $this->enquete = $enquete; } public function getRespostaID() { return $this->respostaID; } public function setRespostaID($respostaID) { $this->respostaID = $respostaID; } public function getDescricao() { return $this->descricao; } public function setDescricao($descricao) { $this->descricao = $descricao; } public function getEnquete() { return $this->enquete; } public function setEnquete($enquete) { $this->enquete = $enquete; } public function toBD() { $resposta = array(); $resposta['respostaID'] = $this->respostaID; $resposta['descricao'] = $this->descricao; $resposta['enqueteID'] = $this->enquete->getEnqueteID(); return $resposta; } public function toJson() { return json_encode($this->toArray()); } } ?>
0a1b2c3d4e5
trunk/leilao/model/RespostaBean.class.php
PHP
asf20
1,457
<?php /** * classe que representa os produtos dos leiloes * @access public * @author Magno Leal * @package model */ class ProdutoBean { private $produtoID; /** * @NotEmptyValidator */ private $descricao; /** * @NotEmptyValidator */ private $peso; /** * @NotEmptyValidator */ private $valorMercado; private $categoriaProduto; private $leilao; private $status; private $medias; function __construct($produtoID = 0, $descricao = "", $peso = -1, $valorMercado = -1, $categoriaProduto = null, $leilao = null, $status = null) { $this->produtoID = $produtoID; $this->valorMercado = $valorMercado; $this->descricao = $descricao; $this->peso = $peso; $this->categoriaProduto = $categoriaProduto; $this->leilao = $leilao; $this->status = $status; } public function getProdutoID() { return $this->produtoID; } public function setProdutoID($produtoID) { $this->produtoID = $produtoID; } public function getValorMercado() { return $this->valorMercado; } public function setValorMercado($valorMercado) { $this->valorMercado = $valorMercado; } public function getDescricao() { return $this->descricao; } public function setDescricao($descricao) { $this->descricao = $descricao; } public function getPeso() { return $this->peso; } public function setPeso($peso) { $this->peso = $peso; } public function getStatus() { return $this->status; } public function setStatus($status) { $this->status = $status; } public function getLeilao() { return $this->leilao; } public function setLeilao($leilao) { $this->leilao = $leilao; } public function getCategoriaProduto() { return $this->categoriaProduto; } public function setCategoriaProduto($categoriaProduto) { $this->categoriaProduto = $categoriaProduto; } public function getMedias() { return $this->medias; } public function setMedias($medias) { $this->medias = $medias; } public function toJson() { return json_encode($this->toBD()); } public function toBD() { $produto = array(); $produto['produtoID'] = $this->produtoID; $produto['valorMercado'] = $this->valorMercado; $produto['descricao'] = $this->descricao; $produto['peso'] = $this->peso; $produto['categoriaProdutoID'] = $this->categoriaProduto->getCategoriaProdutoID(); $produto['leilaoID'] = $this->leilao->getUsuarioID(); $produto['statusID'] = $this->status->getStatusID(); return $produto; } } ?>
0a1b2c3d4e5
trunk/leilao/model/ProdutoBean.class.php
PHP
asf20
2,809
<?php /** * classe que represento as categorias dos produtos: * Informatica, Eletrodomesticos, Games, etc. * @access public * @author Magno Leal * @package model */ class CategoriaProdutoBean { private $categoriaProdutoID; /** * @NotEmptyValidator */ private $descricao; function __construct($categoriaProdutoID = 0, $descricao = "") { $this->categoriaProdutoID = $categoriaProdutoID; $this->descricao = $descricao; } public function getCategoriaProdutoID() { return $this->categoriaProdutoID; } public function setCategoriaProdutoID($categoriaProdutoID) { $this->categoriaProdutoID = $categoriaProdutoID; } public function getDescricao() { return $this->descricao; } public function setDescricao($descricao) { $this->descricao = $descricao; } public function toJson() { return json_encode($this->toBD()); } public function toBD() { $categoriaProduto = array(); $categoriaProduto['categoriaProdutoID'] = $this->categoriaProdutoID; $categoriaProduto['descricao'] = $this->descricao; return $categoriaProduto; } } ?>
0a1b2c3d4e5
trunk/leilao/model/CategoriaProdutoBean.class.php
PHP
asf20
1,199
<?php /** * classe que representa as mensagens trocadas no chat do leilao * @access public * @author Magno Leal * @package model */ class ChatBean { private $chatID; private $data; private $mensagem; private $usuario; private $leilao; function __construct($chatID = 0, $data = "", $mensagem = "", $usuario = null, $leilao = null) { $this->chatID = $chatID; $this->data = $data; $this->mensagem = $mensagem; $this->usuario = $usuario; $this->leilao = $leilao; } public function getChatID() { return $this->chatID; } public function setChatID($chatID) { $this->chatID = $chatID; } public function getData() { return $this->data; } public function setData($data) { $this->data = $data; } public function getMensagem() { return $this->mensagem; } public function setMensagem($mensagem) { $this->mensagem = $mensagem; } public function getUsuario() { return $this->usuario; } public function setUsuario($usuario) { $this->usuario = $usuario; } public function getLeilao() { return $this->leilao; } public function setLeilao($leilao) { $this->leilao = $leilao; } public function toJson() { return json_encode($this->toBD()); } public function toBD() { $chat = array(); $chat['chatID'] = $this->chatID; $chat['data'] = $this->data; $chat['mensagem'] = $this->mensagem; $chat['usuarioID'] = $this->usuario->getUsuarioID(); $chat['leilaoID'] = $this->leilao->getLeilaoID(); return $chat; } } ?>
0a1b2c3d4e5
trunk/leilao/model/ChatBean.class.php
PHP
asf20
1,716
<?php /** * classe que representa os lances dos clientes no leilao * @access public * @author Magno Leal * @package model */ class LanceBean { private $lanceID; private $data; private $usuario; private $leilao; function __construct($lanceID = 0, $data = "", $usuario = null, $leilao = null) { $this->lanceID = $lanceID; $this->data = $data; $this->usuario = $usuario; $this->leilao = $leilao; } public function getLanceID() { return $this->lanceID; } public function setLanceID($lanceID) { $this->lanceID = $lanceID; } public function getData() { return $this->data; } public function setData($data) { $this->data = $data; } public function getUsuario() { return $this->usuario; } public function setUsuario($usuario) { $this->usuario = $usuario; } public function getLeilao() { return $this->leilao; } public function setLeilao($leilao) { $this->leilao = $leilao; } public function toJson() { return json_encode($this->toBD()); } public function toBD() { $lance = array(); $lance['lanceID'] = $this->lanceID; $lance['data'] = $this->data; $lance['usuarioID'] = $this->usuario->getUsuarioID(); $lance['leilaoID'] = $this->leilao->getLeilaoID(); return $lance; } } ?>
0a1b2c3d4e5
trunk/leilao/model/LanceBean.class.php
PHP
asf20
1,455
<?php /** * classe que represento o usuario do site * @access public * @author Magno Leal * @package model */ class UsuarioBean { /** * /@AttributeType long */ private $usuarioID; /** * @MinLengthValidator(min = 5) */ private $login; /** * @MinLengthValidator(min = 5) */ private $senha; /** * @EmailValidator */ private $email; /** * /@AttributeType String */ private $ip; /** * /@AttributeType Timestamp */ private $dataCriacao; /** * /@AttributeType Media */ private $media; /** * /@AttributeType Status */ private $status; function __construct($usuarioID = 0, $login = "", $senha = "", $email = "", $ip = "", $dataCriacao = "", $media = null, $status = null) { $this->usuarioID = $usuarioID; $this->login = $login; $this->senha = $senha; $this->email = $email; $this->ip = $ip; $this->dataCriacao = $dataCriacao; $this->media = $media; $this->status = $status; } public function getUsuarioID() { return $this->usuarioID; } public function setUsuarioID($usuarioID) { $this->usuarioID = $usuarioID; } public function getLogin() { return $this->login; } public function setLogin($login) { $this->login = $login; } public function getSenha() { return $this->senha; } public function setSenha($senha) { $this->senha = $senha; } public function getEmail() { return $this->email; } public function setEmail($email) { $this->email = $email; } public function getIp() { return $this->ip; } public function setIp($ip) { $this->ip = $ip; } public function getDataCriacao() { return $this->dataCriacao; } public function setDataCriacao($dataCriacao) { $this->dataCriacao = $dataCriacao; } public function getMedia() { return $this->media; } public function setMedia($media) { $this->media = $media; } public function getStatus() { return $this->status; } public function setStatus($status) { $this->status = $status; } public function toJson() { return json_encode($this->toBD()); } public function toBD() { $usuario = array(); $usuario['usuarioID'] = $this->usuarioID; $usuario['login'] = $this->login; $usuario['senha'] = $this->senha; $usuario['email'] = $this->email; $usuario['mediaID'] = $this->media->getMediaID(); $usuario['statusID'] = $this->status->getStatusID(); return $usuario; } } ?>
0a1b2c3d4e5
trunk/leilao/model/UsuarioBean.class.php
PHP
asf20
2,929
<?php /** * classe que representa os depoimentos dos cliente que arremataram o leilao * @access public * @author Magno Leal * @package model */ class DepoimentoBean { private $depoimentoID; /** * @NotEmptyValidator */ private $descricao; private $data; private $media; private $cliente; private $status; function __construct($depoimentoID = 0, $descricao = "", $data = "", $media = null, $cliente = null, $status = null) { $this->depoimentoID = $depoimentoID; $this->descricao = $descricao; $this->data = $data; $this->media = $media; $this->cliente = $cliente; $this->status = $status; } public function getDepoimentoID() { return $this->depoimentoID; } public function setDepoimentoID($depoimentoID) { $this->depoimentoID = $depoimentoID; } public function getDescricao() { return $this->descricao; } public function setDescricao($descricao) { $this->descricao = $descricao; } public function getData() { return $this->data; } public function setData($data) { $this->data = $data; } public function getMedia() { return $this->media; } public function setMedia($media) { $this->media = $media; } public function getStatus() { return $this->status; } public function setStatus($status) { $this->status = $status; } public function getCliente() { return $this->cliente; } public function setCliente($cliente) { $this->cliente = $cliente; } public function toJson() { return json_encode($this->toBD()); } public function toBD() { $depoimento = array(); $depoimento['depoimentoID'] = $this->depoimentoID; $depoimento['descricao'] = $this->descricao; $depoimento['data'] = $this->data; $depoimento['mediaID'] = $this->media->getMediaID(); $depoimento['clienteID'] = $this->cliente->getUsuarioID(); $depoimento['statusID'] = $this->status->getStatusID(); return $depoimento; } } ?>
0a1b2c3d4e5
trunk/leilao/model/DepoimentoBean.class.php
PHP
asf20
2,175
<?php /** * classe que representa o Admin * @access public * @author Magno Leal * @package model */ class LeilaoBean { private $leilaoID; /** * @NotEmptyValidator */ private $inicio; private $cronometro; private $media; private $tipoLeilao; private $admin; private $status; private $produtos; private $lances; function __construct($leilaoID = 0, $inicio = "", $cronometro = null, $media = null, $tipoLeilao = null, $admin = null, $status = null) { $this->leilaoID = $leilaoID; $this->media = $media; $this->inicio = $inicio; $this->cronometro = $cronometro; $this->tipoLeilao = $tipoLeilao; $this->admin = $admin; $this->status = $status; } public function getLeilaoID() { return $this->leilaoID; } public function setLeilaoID($leilaoID) { $this->leilaoID = $leilaoID; } public function getMedia() { return $this->media; } public function setMedia($media) { $this->media = $media; } public function getInicio() { return $this->inicio; } public function setInicio($inicio) { $this->inicio = $inicio; } public function getCronometro() { return $this->cronometro; } public function setCronometro($cronometro) { $this->cronometro = $cronometro; } public function getStatus() { return $this->status; } public function setStatus($status) { $this->status = $status; } public function getAdmin() { return $this->admin; } public function setAdmin($admin) { $this->admin = $admin; } public function getTipoLeilao() { return $this->tipoLeilao; } public function setTipoLeilao($tipoLeilao) { $this->tipoLeilao = $tipoLeilao; } public function getProdutos() { return $this->produtos; } public function setProdutos($produtos) { $this->produtos = $produtos; } public function getLances() { return $this->lances; } public function setLances($lances) { $this->lances = $lances; } public function toJson() { return json_encode($this->toBD()); } public function toBD() { $leilao = array(); $leilao['leilaoID'] = $this->leilaoID; $leilao['media'] = $this->media; $leilao['inicio'] = $this->inicio; $leilao['cronometro'] = $this->cronometro; $leilao['tipoLeilaoID'] = $this->tipoLeilao->getTipoLeilaoID(); $leilao['adminID'] = $this->admin->getUsuarioID(); $leilao['statusID'] = $this->status->getStatusID(); return $leilao; } } ?>
0a1b2c3d4e5
trunk/leilao/model/LeilaoBean.class.php
PHP
asf20
2,740
<?php /** * Description of LanceService * * @author Magno */ class LanceService { private $lanceDAO; function __construct() { $this->lanceDAO = new LanceDAO(); } public function salvar($lance) { try { return $this->lanceDAO->salvar($lance); }catch(Exception $err) { throw new Exception($err->getMessage()); } } public function salvarSimples($lanceID, $leilaoID, $usuarioID) { try { return $this->lanceDAO->salvarSimples($lanceID, $leilaoID, $usuarioID); }catch(Exception $err) { throw new Exception($err->getMessage()); } } public function excluir($lanceID) { try { if(!isset ($lanceID) || $lanceID <= 0) throw new Exception("Codigo do Lance Nao Econtrado!!!"); $this->lanceDAO->excluir($lanceID); }catch(Exception $err) { throw new Exception($err->getMessage()); } } public function listar($pagina = 0, $leilaoID = -1, $usuarioID = -1, $carregarDependencias = false) { try { return $this->lanceDAO->listar($pagina, $leilaoID, $usuarioID, $carregarDependencias); }catch(Exception $err) { throw new Exception($err->getMessage()); } } public function listarPorOrdem($pagina = 0, $tamanho = 0, $ordem = "lanceID", $direcao = "DESC", $carregarDependencias = false) { try { return $this->lanceDAO->listarPorOrdem($pagina, $tamanho, $ordem, $direcao, $carregarDependencias); }catch(Exception $err) { throw new Exception($err->getMessage()); } } public function buscarPorID($lanceID, $carregarDependencias = false) { try { if(!isset ($lanceID) || $lanceID <= 0) throw new Exception("Codigo do Lance Nao Econtrado!!!"); return $this->lanceDAO->buscarPorID($lanceID, $carregarDependencias); }catch(Exception $err) { throw new Exception($err->getMessage()); } } public function total($leilaoID = -1, $usuarioID = -1) { try { return $this->lanceDAO->total($leilaoID, $usuarioID); }catch(Exception $err) { throw new Exception($err->getMessage()); } } } ?>
0a1b2c3d4e5
trunk/leilao/service/LanceService.class.php
PHP
asf20
2,333
<?php /** * Description of ProdutoService * * @author Magno */ class ProdutoService { private $produtoDAO; function __construct() { $this->produtoDAO = new ProdutoDAO(); } public function salvar($produto) { try { return $this->produtoDAO->salvar($produto); }catch(Exception $err) { throw new Exception($err->getMessage()); } } public function excluir($produtoID) { try { if(!isset ($produtoID) || $produtoID <= 0) throw new Exception("Codigo da Produto Nao Econtrado!!!"); $this->produtoDAO->excluir($produtoID); }catch(Exception $err) { throw new Exception($err->getMessage()); } } public function listar($pagina = 0, $descricao = -1, $categoriaProdutoID = -1, $leilaoID = -1, $statusID = -1, $carregarDependencias = false) { try { return $this->produtoDAO->listar($pagina, $descricao, $categoriaProdutoID, $leilaoID, $statusID, $carregarDependencias); }catch(Exception $err) { throw new Exception($err->getMessage()); } } public function listarPorOrdem($pagina = 0, $tamanho = 0, $ordem = "produtoID", $direcao = "DESC", $carregarDependencias = false) { try { return $this->produtoDAO->listarPorOrdem($pagina, $tamanho, $ordem, $direcao, $carregarDependencias); }catch(Exception $err) { throw new Exception($err->getMessage()); } } public function buscarPorID($produtoID, $carregarDependencias = false) { try { if(!isset ($produtoID) || $produtoID <= 0) throw new Exception("Codigo da Produto Nao Econtrado!!!"); return $this->produtoDAO->buscarPorID($produtoID, $carregarDependencias); }catch(Exception $err) { throw new Exception($err->getMessage()); } } public function total($descricao = -1, $categoriaProdutoID = -1, $leilaoID = -1, $statusID = -1) { try { return $this->produtoDAO->total($descricao, $categoriaProdutoID, $leilaoID, $statusID); }catch(Exception $err) { throw new Exception($err->getMessage()); } } } ?>
0a1b2c3d4e5
trunk/leilao/service/ProdutoService.class.php
PHP
asf20
2,257
<?php /** * Description of TipoLeilaoService * * @author Magno */ class TipoLeilaoService { private $tipoLeilaoDAO; public function __construct() { $this->tipoLeilaoDAO = new TipoLeilaoDAO(); } public function salvar($tipoLeilao) { try { return $this->tipoLeilaoDAO->salvar($tipoLeilao); }catch(Exception $err) { throw new Exception($err->getMessage()); } } public function excluir($tipoLeilaoID) { try { if(!isset ($tipoLeilaoID) || $tipoLeilaoID <= 0) throw new Exception("Codigo do TipoLeilao Nao Econtrado!!!"); $this->tipoLeilaoDAO->excluir($tipoLeilaoID); }catch(Exception $err) { throw new Exception($err->getMessage()); } } public function listar($pagina = 0,$descricao = "") { try { return $this->tipoLeilaoDAO->listar($pagina, $descricao); }catch(Exception $err) { throw new Exception($err->getMessage()); } } public function buscarPorID($tipoLeilaoID) { try { if(!isset ($tipoLeilaoID) || $tipoLeilaoID <= 0) throw new Exception("Codigo do TipoLeilao Nao Econtrado!!!"); $this->tipoLeilaoDAO->buscarPorID($tipoLeilaoID); }catch(Exception $err) { throw new Exception($err->getMessage()); } } public function total($descricao = "") { try { return $this->tipoLeilaoDAO->total($descricao); }catch(Exception $err) { throw new Exception($err->getMessage()); } } } ?>
0a1b2c3d4e5
trunk/leilao/service/TipoLeilaoService.class.php
PHP
asf20
1,640
<?php /** * Description of ConviteService * * @author Magno */ class ConviteService { private $conviteDAO; function __construct() { $this->conviteDAO = new ConviteDAO(); } public function salvar($convite) { try { return $this->conviteDAO->salvar($convite); }catch(Exception $err) { throw new Exception($err->getMessage()); } } public function salvarConvites($convites){ $conexao = Conexao::getConexao(); $conexao->beginTransaction(); try { for ($i = 0; $i < count($convites); $i++) { $convites[$i] = $this->salvar($convites[$i]); } } catch (Exception $exc) { $conexao->rollBack(); throw new Exception($exc->getMessage()); } $conexao->commit(); return $convites; } public function enviarConvites($convites){ try { $emailService = new EmailService(); for ($i = 0; $i < count($convites); $i++) { $convite = $convites[$i]; $emailService->enviarEmail($convite->getEmail(), $convite->getMensagem()); } } catch (Exception $exc) { throw new Exception($exc->getMessage()); } } public function excluir($conviteID) { try { if(!isset ($conviteID) || $conviteID <= 0) throw new Exception("Codigo da Convite Nao Econtrado!!!"); $this->conviteDAO->excluir($conviteID); }catch(Exception $err) { throw new Exception($err->getMessage()); } } public function listar($pagina = 0, $email = -1, $usuarioID = -1, $statusID = -1, $carregarDependencias = false) { try { return $this->conviteDAO->listar($pagina, $email, $usuarioID, $statusID, $carregarDependencias); }catch(Exception $err) { throw new Exception($err->getMessage()); } } public function listarPorOrdem($pagina = 0, $tamanho = 0, $ordem = "conviteID", $direcao = "DESC", $carregarDependencias = false) { try { return $this->conviteDAO->listarPorOrdem($pagina, $tamanho, $ordem, $direcao, $carregarDependencias); }catch(Exception $err) { throw new Exception($err->getMessage()); } } public function buscarPorID($conviteID, $carregarDependencias = false) { try { if(!isset ($conviteID) || $conviteID <= 0) throw new Exception("Codigo da Convite Nao Econtrado!!!"); return $this->conviteDAO->buscarPorID($conviteID, $carregarDependencias); }catch(Exception $err) { throw new Exception($err->getMessage()); } } public function total($email = -1, $usuarioID = -1, $statusID = -1) { try { return $this->conviteDAO->total($email, $usuarioID, $statusID); }catch(Exception $err) { throw new Exception($err->getMessage()); } } } ?>
0a1b2c3d4e5
trunk/leilao/service/ConviteService.class.php
PHP
asf20
3,162
<?php /** * Description of EnqueteService * * @author Magno */ class EnqueteService { private $enqueteDAO; function __construct() { $this->enqueteDAO = new EnqueteDAO(); } public function salvar($enquete) { try { return $this->enqueteDAO->salvar($enquete); }catch(Exception $err) { throw new Exception($err->getMessage()); } } public function excluir($enqueteID) { try { if(!isset ($enqueteID) || $enqueteID <= 0) throw new Exception("Codigo da Enquete Nao Econtrado!!!"); $this->enqueteDAO->excluir($enqueteID); }catch(Exception $err) { throw new Exception($err->getMessage()); } } public function listar($pagina = 0, $inicio = "", $descricao = "", $statusID = -1) { try { return $this->enqueteDAO->listar($pagina, $inicio, $descricao, $statusID); }catch(Exception $err) { throw new Exception($err->getMessage()); } } public function listarPorOrdem($pagina = 0, $tamanho = 0, $ordem = "enqueteID", $direcao = "DESC") { try { return $this->enqueteDAO->listarPorOrdem($pagina, $tamanho, $ordem, $direcao); }catch(Exception $err) { throw new Exception($err->getMessage()); } } public function buscarPorID($enqueteID) { try { if(!isset ($enqueteID) || $enqueteID <= 0) throw new Exception("Codigo da Enquete Nao Econtrado!!!"); return $this->enqueteDAO->buscarPorID($enqueteID); }catch(Exception $err) { throw new Exception($err->getMessage()); } } public function total($inicio = "", $descricao = "", $statusID = -1) { try { return $this->enqueteDAO->total($inicio, $descricao, $statusID); }catch(Exception $err) { throw new Exception($err->getMessage()); } } } ?>
0a1b2c3d4e5
trunk/leilao/service/EnqueteService.class.php
PHP
asf20
1,993
<?php class ClienteService { private $clienteDAO; public function __construct() { $this->clienteDAO = new ClienteDAO(); } public function salvar($cliente) { $conexao = Conexao::getConexao(); $conexao->beginTransaction(); try { $cliente->setSenha(Seguranca::criptografaSenha($cliente->getSenha())); if($cliente->getUsuarioID() <= 0){ if($this->exitePorEmail($cliente->getEmail())) throw new Exception("Erro, ja existe um Usuario com esse Email!!!"); if($this->exitePorLogin($cliente->getLogin())) throw new Exception("Erro, ja existe um Usuario com esse Login!!!"); if($this->exitePorCpf($cliente->getPessoa()->getCpf())) throw new Exception("Erro, ja existe um Usuario com esse CPF!!!"); if(!Util::validaCPF($cliente->getPessoa()->getCpf())) throw new Exception("Erro, CPF Inválido!!!"); } $cliente = $this->clienteDAO->salvar($cliente); if(!strpos($cliente->getMedia()->getCaminho(), Constantes::$IMG_CLI_DEFAULT)){ Util::geraThumb($cliente->getMedia()->getCaminho(), Constantes::$TAM_THUMB_IMG); } $conexao->commit(); return $cliente; } catch (Exception $err) { $conexao->rollBack(); throw new Exception($err->getMessage()); } } public function excluir($usuarioID) { try { if (!isset($usuarioID) || $usuarioID <= 0) throw new Exception("Codigo do Usuario Nao Econtrado!!!"); $this->clienteDAO->excluir($usuarioID); } catch (Exception $err) { throw new Exception($err->getMessage()); } } public function listar($pagina = 0, $email = "", $login = "", $statusID = -1, $carregarDependencias = false) { try { return $this->clienteDAO->listar($pagina, $email, $login, $statusID, $carregarDependencias); } catch (Exception $err) { throw new Exception($err->getMessage()); } } public function listarPorOrdem($pagina = 0, $tamanho = 0, $ordem = "usuarioID", $direcao = "DESC", $carregarDependencias = false) { try { return $this->clienteDAO->listarPorOrdem($pagina, $tamanho, $ordem, $direcao, $carregarDependencias); } catch (Exception $err) { throw new Exception($err->getMessage()); } } public function buscarPorID($usuarioID, $carregarDependencias = false) { try { if (!isset($usuarioID) || $usuarioID <= 0) throw new Exception("Codigo do Usuario Nao Econtrado!!!"); return $this->clienteDAO->buscarPorID($usuarioID, $carregarDependencias); } catch (Exception $err) { throw new Exception($err->getMessage()); } } public function total($email = "", $login = "", $statusID = -1) { try { return $this->clienteDAO->total($email, $login, $statusID); } catch (Exception $err) { throw new Exception($err->getMessage()); } } public function exitePorCpf($cpf){ $pessoaService = new PessoaService(); return $pessoaService->exitePorCpf($cpf); } public function exitePorEmail($email){ if($this->total($email) > 0) return true; return false; } public function exitePorLogin($login){ if($this->total("",$login) > 0) return true; return false; } } ?>
0a1b2c3d4e5
trunk/leilao/service/ClienteService.class.php
PHP
asf20
3,674
<?php /** * Description of LeilaoService * * @author Magno */ class LeilaoService { private $leilaoDAO; function __construct() { $this->leilaoDAO = new LeilaoDAO(); } public function salvar($leilao) { try { return $this->leilaoDAO->salvar($leilao); }catch(Exception $err) { throw new Exception($err->getMessage()); } } public function excluir($leilaoID) { try { if(!isset ($leilaoID) || $leilaoID <= 0) throw new Exception("Codigo da Leilao Nao Econtrado!!!"); $this->leilaoDAO->excluir($leilaoID); }catch(Exception $err) { throw new Exception($err->getMessage()); } } public function listar($pagina = 0, $inicio = "", $tipoLeilaoID = -1, $cronometroID = -1, $statusID = -1, $usuarioID = -1, $carregarDependencias = false) { try { return $this->leilaoDAO->listar($pagina, $inicio, $tipoLeilaoID, $cronometroID, $statusID, $usuarioID, $carregarDependencias); }catch(Exception $err) { throw new Exception($err->getMessage()); } } public function listarPorOrdem($pagina = 0, $tamanho = 0, $ordem = "leilaoID", $direcao = "DESC", $carregarDependencias = false) { try { return $this->leilaoDAO->listarPorOrdem($pagina, $tamanho, $ordem, $direcao, $carregarDependencias); }catch(Exception $err) { throw new Exception($err->getMessage()); } } public function buscarPorID($leilaoID, $carregarDependencias = false) { try { if(!isset ($leilaoID) || $leilaoID <= 0) throw new Exception("Codigo da Leilao Nao Econtrado!!!"); return $this->leilaoDAO->buscarPorID($leilaoID, $carregarDependencias); }catch(Exception $err) { throw new Exception($err->getMessage()); } } public function total($inicio = "", $tipoLeilaoID = -1, $cronometroID = -1, $statusID = -1, $usuarioID = -1) { try { return $this->leilaoDAO->total($inicio, $tipoLeilaoID, $cronometroID, $statusID, $usuarioID); }catch(Exception $err) { throw new Exception($err->getMessage()); } } } ?>
0a1b2c3d4e5
trunk/leilao/service/LeilaoService.class.php
PHP
asf20
2,271
<?php /** * Description of LoginService * * @author Magno */ class LoginService { private $loginDAO; function __construct() { $this->loginDAO = new LoginDAO(); } public function salvar($login) { try { return $this->loginDAO->salvar($login); }catch(Exception $err) { throw new Exception($err->getMessage()); } } public function excluir($loginID) { try { if(!isset ($loginID) || $loginID <= 0) throw new Exception("Codigo da Login Nao Econtrado!!!"); $this->loginDAO->excluir($loginID); }catch(Exception $err) { throw new Exception($err->getMessage()); } } public function listar($pagina = 0,$usuarioID = 0) { try { return $this->loginDAO->listar($pagina, $usuarioID); }catch(Exception $err) { throw new Exception($err->getMessage()); } } public function buscarPorID($loginID) { try { if(!isset ($loginID) || $loginID <= 0) throw new Exception("Codigo da Login Nao Econtrado!!!"); return $this->loginDAO->buscarPorID($loginID); }catch(Exception $err) { throw new Exception($err->getMessage()); } } public function total($usuarioID = 0) { try { return $this->loginDAO->total($usuarioID); }catch(Exception $err) { throw new Exception($err->getMessage()); } } } ?>
0a1b2c3d4e5
trunk/leilao/service/LoginService.class.php
PHP
asf20
1,533