package org.mercury_im.messenger.di.component;

import org.mercury_im.messenger.MercuryImApplication;
import org.mercury_im.messenger.data.di.RepositoryModule;
import org.mercury_im.messenger.di.module.AndroidPersistenceModule;
import org.mercury_im.messenger.di.module.AppModule;
import org.mercury_im.messenger.service.MercuryConnectionService;
import org.mercury_im.messenger.store.MercuryEntityCapsStore;
import org.mercury_im.messenger.ui.MainActivity;
import org.mercury_im.messenger.ui.chat.ChatActivity;
import org.mercury_im.messenger.ui.chat.ChatInputFragment;
import org.mercury_im.messenger.ui.chat.ChatInputViewModel;
import org.mercury_im.messenger.ui.chat.ChatViewModel;
import org.mercury_im.messenger.ui.chatlist.ChatListViewModel;
import org.mercury_im.messenger.ui.account.AccountsViewModel;
import org.mercury_im.messenger.ui.account.LoginActivity;
import org.mercury_im.messenger.ui.account.LoginViewModel;
import org.mercury_im.messenger.ui.roster.contacts.ContactListViewModel;

import javax.inject.Singleton;

import dagger.Component;

/**
 * Main Application Component that binds together all the modules needed for the Android
 * application.
 */
@Singleton
@Component(
        modules = {
                AppModule.class,
                AndroidPersistenceModule.class,
                RepositoryModule.class
        })
public interface AppComponent {

    // Application

    void inject(MercuryImApplication mercuryImApplication);


    // Views

    void inject(MainActivity mainActivity);

    void inject(LoginActivity loginActivity);

    void inject(ChatActivity chatActivity);

    void inject(ChatInputFragment chatInputFragment);

    void inject(ChatListViewModel chatListViewModel);


    // ViewModels

    void inject(ContactListViewModel contactListViewModel);

    void inject(ChatViewModel chatViewModel);

    void inject(ChatInputViewModel chatInputViewModel);

    void inject(LoginViewModel loginViewModel);

    void inject(AccountsViewModel accountsViewModel);


    // Services

    void inject(MercuryConnectionService service);


    void inject(MercuryEntityCapsStore store);
}
